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
 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 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 resetCrudEngines(String names)
          In the case any dynamic SQL CRUD Engine is in the cache, the static one is re-established.
 String resetProcedureEngines(String names)
          In the case a dynamic SQL Procedure Engine is in the cache, the static one is re-established.
 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

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


Copyright © 2014. All rights reserved.