org.sqlproc.engine.jmx
Class SqlSimpleFactoryMXBean

java.lang.Object
  extended by org.sqlproc.engine.jmx.SqlSimpleFactoryMXBean

public class SqlSimpleFactoryMXBean
extends Object

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
private  SqlEngineFactory sqlEngineFactory
          The SQL Engine factory instance
 
Constructor Summary
SqlSimpleFactoryMXBean()
           
 
Method Summary
 void clearConfiguration()
          Resets the state of the dynamic configuration instance.
 void clearConfigurationUsage()
          Reset the engines' usage counters.
 Boolean getAsyncInit()
          Returns the indicator the initialization process should be done asynchronously
private  SqlEngineConfiguration getConfiguration()
          Returns the dynamic SQL Processor configuration ant checks it's not null
 List<String> getCrudEngineProcessingCache(String name)
          Returns the processing cache used for the selected SQL CRUD Engine
 List<String> getCrudEnginesToInit()
          Returns the container of the CRUD Engines' names, which has to be initialized.
 int getCrudEngineUsage(String name)
          Returns the CRUD Engine usage number.
 List<String> getDynamicNames()
          Returns the collection of names of all initialized/constructed dynamic SQL Engine instances.
 Boolean getInitInUsageOrder()
          Returns the indicator that the most frequently used engines should be initialized preferentially
 Integer getInitTreshold()
          Returns the initialization threshold.
 List<String> getNames()
          Returns the collection of names of all initialized/constructed static SQL Engine instances.
 List<String> getProcedureEngineProcessingCache(String name)
          Returns the processing cache used for the selected SQL Procedure Engine
 List<String> getProcedureEnginesToInit()
          Returns the container of the Procedure Engines' names, which has to be initialized.
 int getProcedureEngineUsage(String name)
          Returns the Procedure Engine usage number.
 List<String> getQueryEngineProcessingCache(String name)
          Returns the processing cache used for the selected SQL Query Engine
 List<String> getQueryEnginesToInit()
          Returns the container of the Query Engines' names, which has to be initialized.
 int getQueryEngineUsage(String name)
          Returns the Query Engine usage number.
 int initCrudEngines(String names)
          In the case the SQL CRUD Engines are not initialized, a new static instances are established in the cache.
 int initProcedureEngines(String names)
          In the case the SQL Procedure Engines are not initialized, a new static instances are established in the cache.
 int 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
 void loadConfiguration()
          Loads the persisted configuration.
 void newCrudEngine(String name, String sqlStatement)
          A new dynamic SQL CRUD Engine instance is established in the cache.
 void newProcedureEngine(String name, String sqlStatement)
          A new dynamic SQL Procedure Engine instance is established in the cache.
 void newQueryEngine(String name, String sqlStatement)
          A new dynamic SQL Query Engine instance is established in the cache.
 int resetCrudEngineProcessingCache(String name, String names)
          Clears the processing cache used for the selected SQL CRUD Engine
 int resetCrudEngines(String names)
          In the case any dynamic SQL CRUD Engine is in the cache, the static one is re-established.
 int resetCrudEngineUsage(String name)
          Resets the CRUD Engine usage number.
 int resetProcedureEngineProcessingCache(String name, String names)
          Clears the processing cache used for the selected SQL Procedure Engine
 int resetProcedureEngines(String names)
          In the case a dynamic SQL Procedure Engine is in the cache, the static one is re-established.
 int resetProcedureEngineUsage(String name)
          Resets the Procedure Engine usage number.
 int resetQueryEngineProcessingCache(String name, String names)
          Clears the processing cache used for the selected SQL Query Engine
 int resetQueryEngines(String names)
          In the case any dynamic SQL Query Engine is in the cache, the static one is re-established.
 int resetQueryEngineUsage(String name)
          Resets the Query Engine usage number.
 void setAsyncInit(Boolean asyncInit)
          Sets the indicator the initialization process should be done asynchronously
 void setInitInUsageOrder(Boolean initInUsageOrder)
          Sets the indicator that the most frequently used engines should be initialized preferentially
 void setInitTreshold(Integer initTreshold)
          Sets the initialization threshold.
 void setLazyInit(boolean lazyInit)
          Sets the indicator to speed up the initialization process
 void setSqlEngineFactory(SqlEngineFactory sqlEngineFactory)
          Sets the SQL Engine factory instance
 void storeConfiguration()
          Persists the configuration into the external file.
private  List<String> toList(List<SqlEngineConfiguration.NameValue> namevals)
          Converts list
 
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

Constructor Detail

SqlSimpleFactoryMXBean

public SqlSimpleFactoryMXBean()
Method Detail

initQueryEngines

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

Parameters:
names - the names of the required SQL Query Engines instances
Returns:
the number of successfully initialized engines

initCrudEngines

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

Parameters:
names - the names of the required SQL CRUD Engines instances
Returns:
the number of successfully initialized engines

initProcedureEngines

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

Parameters:
names - the names of the required SQL Procedure Engines instances
Returns:
the number of successfully initialized engines

resetQueryEngines

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

Parameters:
names - the names of the required SQL Query Engines instances
Returns:
the number of successfully reset engines

resetCrudEngines

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

Parameters:
names - the names of the required SQL CRUD Engines instances
Returns:
the number of successfully reset engines

resetProcedureEngines

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

Parameters:
names - the names of the required SQL Procedure Engines instances
Returns:
the number of successfully reset engines

newQueryEngine

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

Parameters:
name - the name of the required SQL Query Engine instance
sqlStatement - the new SQL statement, which is going to replace the original one
Throws:
SqlEngineException

newCrudEngine

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

Parameters:
name - the name of the required SQL CRUD Engine instance
sqlStatement - the new SQL statement, which is going to replace the original one

newProcedureEngine

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

Parameters:
name - the name of the required SQL Procedure Engine instance
sqlStatement - the new SQL statement, which is going to replace the original one

getNames

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

Returns:
The collection of all initialized static SQL Engine instances' names

getDynamicNames

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

Returns:
The collection of all initialized dynamic SQL Engine instances' names

getQueryEngineProcessingCache

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

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 List<String> getCrudEngineProcessingCache(String name)
Returns the processing cache used for the selected SQL CRUD Engine

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 List<String> getProcedureEngineProcessingCache(String name)
Returns the processing cache used for the selected SQL Procedure Engine

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 int resetQueryEngineProcessingCache(String name,
                                           String names)
Clears the processing cache used for the selected SQL Query Engine

Parameters:
name - the name of the required SQL Query Engine
names - the names of the processing cache entries to be cleared
Returns:
the number of successfully reset engine cache entries

resetCrudEngineProcessingCache

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

Parameters:
name - the name of the required SQL CRUD Engine
names - the names of the processing cache entries to be cleared
Returns:
the number of successfully reset engine cache entries

resetProcedureEngineProcessingCache

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

Parameters:
name - the name of the required SQL Procedure Engine
names - the names of the processing cache entries to be cleared
Returns:
the number of successfully reset engine cache entries

getConfiguration

private SqlEngineConfiguration getConfiguration()
Returns the dynamic SQL Processor configuration ant checks it's not null

Returns:
the dynamic SQL Processor configuration

isLazyInit

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

Returns:
the indicator to speed up the initialization process

setLazyInit

public void setLazyInit(boolean lazyInit)
Sets the indicator to speed up the initialization process

Parameters:
lazyInit - the indicator to speed up the initialization process

getAsyncInit

public Boolean getAsyncInit()
Returns the indicator the initialization process should be done asynchronously

Returns:
the indicator the initialization process should be done asynchronously

setAsyncInit

public void setAsyncInit(Boolean asyncInit)
Sets the indicator the initialization process should be done asynchronously

Parameters:
asyncInit - the indicator the initialization process should be done asynchronously

getInitTreshold

public Integer getInitTreshold()
Returns the initialization threshold. The engines, which usage is at least this number should be initialized directly

Returns:
the initialization threshold. The engines, which usage is at least this number should be initialized directly

setInitTreshold

public void setInitTreshold(Integer initTreshold)
Sets the initialization threshold. The engines, which usage is at least this number should be initialized directly

Parameters:
initTreshold - the initialization threshold. The engines, which usage is at least this number should be initialized directly

getInitInUsageOrder

public Boolean getInitInUsageOrder()
Returns the indicator that the most frequently used engines should be initialized preferentially

Returns:
the indicator that the most frequently used engines should be initialized preferentially

setInitInUsageOrder

public void setInitInUsageOrder(Boolean initInUsageOrder)
Sets the indicator that the most frequently used engines should be initialized preferentially

Parameters:
initInUsageOrder - the indicator that the most frequently used engines should be initialized preferentially

loadConfiguration

public void loadConfiguration()
Loads the persisted configuration.


storeConfiguration

public void storeConfiguration()
Persists the configuration into the external file.


clearConfiguration

public void clearConfiguration()
Resets the state of the dynamic configuration instance.


clearConfigurationUsage

public void clearConfigurationUsage()
Reset the engines' usage counters.


toList

private List<String> toList(List<SqlEngineConfiguration.NameValue> namevals)
Converts list

Parameters:
namevals - the input list
Returns:
the output list

getQueryEnginesToInit

public List<String> getQueryEnginesToInit()
Returns the container of the Query Engines' names, which has to be initialized. This is called during The SQL Processor initialization, so there's no need to handle concurrent changes.

Returns:
the container of the Query Engines' names, which has to be initialized

getCrudEnginesToInit

public List<String> getCrudEnginesToInit()
Returns the container of the CRUD Engines' names, which has to be initialized. This is called during The SQL Processor initialization, so there's no need to handle concurrent changes.

Returns:
the container of the CRUD Engines' names, which has to be initialized

getProcedureEnginesToInit

public List<String> getProcedureEnginesToInit()
Returns the container of the Procedure Engines' names, which has to be initialized. This is called during The SQL Processor initialization, so there's no need to handle concurrent changes.

Returns:
the container of the Procedure Engines' names, which has to be initialized

getQueryEngineUsage

public int getQueryEngineUsage(String name)
Returns the Query Engine usage number.

Parameters:
name - the name of the SQL Query Engine
Returns:
the Query Engine usage number

getCrudEngineUsage

public int getCrudEngineUsage(String name)
Returns the CRUD Engine usage number.

Parameters:
name - the name of the SQL CRUD Engine
Returns:
the CRUD Engine usage number

getProcedureEngineUsage

public int getProcedureEngineUsage(String name)
Returns the Procedure Engine usage number.

Parameters:
name - the name of the SQL Procedure Engine
Returns:
the Procedure Engine usage number

resetQueryEngineUsage

public int resetQueryEngineUsage(String name)
Resets the Query Engine usage number.

Parameters:
name - the name of the SQL Query Engine
Returns:
the Query Engine usage number

resetCrudEngineUsage

public int resetCrudEngineUsage(String name)
Resets the CRUD Engine usage number.

Parameters:
name - the name of the SQL CRUD Engine
Returns:
the CRUD Engine usage number

resetProcedureEngineUsage

public int resetProcedureEngineUsage(String name)
Resets the Procedure Engine usage number.

Parameters:
name - the name of the SQL Procedure Engine
Returns:
the Procedure Engine usage number

setSqlEngineFactory

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

Parameters:
sqlEngineFactory - the SQL Engine factory instance


Copyright © 2015. All rights reserved.