org.sqlproc.engine.jmx
Class SqlSimpleFactoryJmx

java.lang.Object
  extended by org.sqlproc.engine.jmx.SqlSimpleFactoryJmx
All Implemented Interfaces:
SqlSimpleFactoryMXBean

public class SqlSimpleFactoryJmx
extends Object
implements SqlSimpleFactoryMXBean

The implementation of the simplified JMX interface for the SQL Engine factory.

The factory can be based on Spring DI framework for example.

For more info please see the Tutorials.

Author:
Vladimir Hudec

Field Summary
static String OK
           
private  SqlEngineFactory sqlEngineFactory
          The SQL Engine factory instance
 
Constructor Summary
SqlSimpleFactoryJmx()
           
 
Method Summary
private  String collectionToString(Collection<String> collection)
           
 String getCrudEngineProcessingCache(String name)
          Returns the processing cache used for the selected SQL CRUD Engine
 String getDynamicNames()
          Returns the collection of names of all initialized/constructed dynamic SQL Engine instances.
 String getNames()
          Returns the collection of names of all initialized/constructed static SQL Engine instances.
 String getProcedureEngineProcessingCache(String name)
          Returns the processing cache used for the selected SQL Procedure Engine
 String getQueryEngineProcessingCache(String name)
          Returns the processing cache used for the selected SQL Query Engine
 String initCrudEngines(String names)
          In the case the SQL CRUD Engines are not initialized, a new static instances are established in the cache.
 String initProcedureEngines(String names)
          In the case the SQL Procedure Engines are not initialized, a new static instances are established in the cache.
 String initQueryEngines(String names)
          In the case the SQL Query Engines are not initialized, a new static instances are established in the cache.
 boolean isLazyInit()
          Returns the indicator to speed up the initialization process
 String newCrudEngine(String name, String sqlStatement)
          A new dynamic SQL CRUD Engine instance is established in the cache.
 String newProcedureEngine(String name, String sqlStatement)
          A new dynamic SQL Procedure Engine instance is established in the cache.
 String newQueryEngine(String name, String sqlStatement)
          A new dynamic SQL Query Engine instance is established in the cache.
 String resetCrudEngineProcessingCache(String name, String names)
          Clears the processing cache used for the selected SQL CRUD Engine
 String resetCrudEngines(String names)
          In the case any dynamic SQL CRUD Engine is in the cache, the static one is re-established.
 String resetProcedureEngineProcessingCache(String name, String names)
          Clears the processing cache used for the selected SQL Procedure Engine
 String resetProcedureEngines(String names)
          In the case a dynamic SQL Procedure Engine is in the cache, the static one is re-established.
 String resetQueryEngineProcessingCache(String name, String names)
          Clears the processing cache used for the selected SQL Query Engine
 String resetQueryEngines(String names)
          In the case any dynamic SQL Query Engine is in the cache, the static one is re-established.
 void setSqlEngineFactory(SqlEngineFactory sqlEngineFactory)
          Sets the SQL Engine factory instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlEngineFactory

private SqlEngineFactory sqlEngineFactory
The SQL Engine factory instance


OK

public static final String OK
See Also:
Constant Field Values
Constructor Detail

SqlSimpleFactoryJmx

public SqlSimpleFactoryJmx()
Method Detail

initQueryEngines

public String initQueryEngines(String names)
In the case the SQL Query Engines are not initialized, a new static instances are established in the cache.

Specified by:
initQueryEngines in interface SqlSimpleFactoryMXBean
Parameters:
names - the names of the required SQL Query Engines instances
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

initCrudEngines

public String initCrudEngines(String names)
In the case the SQL CRUD Engines are not initialized, a new static instances are established in the cache.

Specified by:
initCrudEngines in interface SqlSimpleFactoryMXBean
Parameters:
names - the names of the required SQL CRUD Engines instances
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

initProcedureEngines

public String initProcedureEngines(String names)
In the case the SQL Procedure Engines are not initialized, a new static instances are established in the cache.

Specified by:
initProcedureEngines in interface SqlSimpleFactoryMXBean
Parameters:
names - the names of the required SQL Procedure Engines instances
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

resetQueryEngines

public String resetQueryEngines(String names)
In the case any dynamic SQL Query Engine is in the cache, the static one is re-established.

Specified by:
resetQueryEngines in interface SqlSimpleFactoryMXBean
Parameters:
names - the names of the required SQL Query Engines instances
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

resetCrudEngines

public String resetCrudEngines(String names)
In the case any dynamic SQL CRUD Engine is in the cache, the static one is re-established.

Specified by:
resetCrudEngines in interface SqlSimpleFactoryMXBean
Parameters:
names - the names of the required SQL CRUD Engines instances
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

resetProcedureEngines

public String resetProcedureEngines(String names)
In the case a dynamic SQL Procedure Engine is in the cache, the static one is re-established.

Specified by:
resetProcedureEngines in interface SqlSimpleFactoryMXBean
Parameters:
names - the names of the required SQL Procedure Engines instances
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

newQueryEngine

public String newQueryEngine(String name,
                             String sqlStatement)
                      throws SqlEngineException
A new dynamic SQL Query Engine instance is established in the cache. The static one is suppressed.

Specified by:
newQueryEngine in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL Query Engine instance
sqlStatement - the new SQL statement, which is going to replace the original one
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.
Throws:
SqlEngineException

newCrudEngine

public String newCrudEngine(String name,
                            String sqlStatement)
A new dynamic SQL CRUD Engine instance is established in the cache. The static one is suppressed.

Specified by:
newCrudEngine in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL CRUD Engine instance
sqlStatement - the new SQL statement, which is going to replace the original one
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

newProcedureEngine

public String newProcedureEngine(String name,
                                 String sqlStatement)
A new dynamic SQL Procedure Engine instance is established in the cache. The static one is suppressed.

Specified by:
newProcedureEngine in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL Procedure Engine instance
sqlStatement - the new SQL statement, which is going to replace the original one
Returns:
for the case there's an error thrown, the error Message. Otherwise the OK.

getNames

public String getNames()
Returns the collection of names of all initialized/constructed static SQL Engine instances.

Specified by:
getNames in interface SqlSimpleFactoryMXBean
Returns:
The collection of all initialized static SQL Engine instances' names

getDynamicNames

public String getDynamicNames()
Returns the collection of names of all initialized/constructed dynamic SQL Engine instances.

Specified by:
getDynamicNames in interface SqlSimpleFactoryMXBean
Returns:
The collection of all initialized dynamic SQL Engine instances' names

collectionToString

private String collectionToString(Collection<String> collection)

isLazyInit

public boolean isLazyInit()
Returns the indicator to speed up the initialization process

Specified by:
isLazyInit in interface SqlSimpleFactoryMXBean
Returns:
the indicator to speed up the initialization process

setSqlEngineFactory

public void setSqlEngineFactory(SqlEngineFactory sqlEngineFactory)
Sets the SQL Engine factory instance

Parameters:
sqlEngineFactory - the SQL Engine factory instance

getQueryEngineProcessingCache

public String getQueryEngineProcessingCache(String name)
Returns the processing cache used for the selected SQL Query Engine

Specified by:
getQueryEngineProcessingCache in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL Query Engine
Returns:
the processing cache used for the selected SQL Query Engine or the error message

getCrudEngineProcessingCache

public String getCrudEngineProcessingCache(String name)
Returns the processing cache used for the selected SQL CRUD Engine

Specified by:
getCrudEngineProcessingCache in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL CRUD Engine
Returns:
the processing cache used for the selected SQL CRUD Engine or the error message

getProcedureEngineProcessingCache

public String getProcedureEngineProcessingCache(String name)
Returns the processing cache used for the selected SQL Procedure Engine

Specified by:
getProcedureEngineProcessingCache in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL Procedure Engine
Returns:
the processing cache used for the selected SQL Procedure Engine or the error message

resetQueryEngineProcessingCache

public String resetQueryEngineProcessingCache(String name,
                                              String names)
Clears the processing cache used for the selected SQL Query Engine

Specified by:
resetQueryEngineProcessingCache in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL Query Engine
names - the names of the processing cache entries to be cleared
Returns:
the OK or the error message

resetCrudEngineProcessingCache

public String resetCrudEngineProcessingCache(String name,
                                             String names)
Clears the processing cache used for the selected SQL CRUD Engine

Specified by:
resetCrudEngineProcessingCache in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL CRUD Engine
names - the names of the processing cache entries to be cleared
Returns:
the OK or the error message

resetProcedureEngineProcessingCache

public String resetProcedureEngineProcessingCache(String name,
                                                  String names)
Clears the processing cache used for the selected SQL Procedure Engine

Specified by:
resetProcedureEngineProcessingCache in interface SqlSimpleFactoryMXBean
Parameters:
name - the name of the required SQL Procedure Engine
names - the names of the processing cache entries to be cleared
Returns:
the OK or the error message


Copyright © 2015. All rights reserved.