|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.util.SetupReader
org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactorySetupReader
public class PooledDatabaseConnectionFactorySetupReader
Class that reads setup for database connection pools from properties. Each pool have unique name. For this name class will find all properties for name or wil use default values if property with name is not present. The DBCP configuration is available at http://jakarta.apache.org/commons/dbcp/configuration.html The XAPool configuration is available at file:///e:/Development/OpenSubsystems/external/xapool/jdoc/index.html see classes StandardXADataSource, StandardXAPoolDataSource The C3P0 configuration is available at http://www.mchange.com/projects/c3p0/index.html#appendix_a The Proxool configuraion is available at http://proxool.sourceforge.net/properties.html
| Field Summary | |
|---|---|
static java.lang.String |
DATABASE_POOL_BASE_PATH
base path for all properties |
static java.lang.String |
DBPOOL_CAN_GROW
Can the connection pool grow above maximal size or should it block. |
static boolean |
DBPOOL_CAN_GROW_DEFAULT
Can the connection pool grow above maximal size or should it block. |
static java.lang.String |
DBPOOL_CHECK_LEVEL
How thoroughly to validate the objects in the pool. |
static int |
DBPOOL_CHECK_LEVEL_DEFAULT
How thoroughly to validate the objects in the pool. |
static java.lang.String |
DBPOOL_IDLE_CHECK_PERIOD
How often to validate idle connections. |
static long |
DBPOOL_IDLE_CHECK_PERIOD_DEFAULT
How often to validate idle connections. |
static java.lang.String |
DBPOOL_IDLE_CHECK_SIZE
How many of the idle connections to test during one test run. |
static int |
DBPOOL_IDLE_CHECK_SIZE_DEFAULT
How much of the idle connections to test during one test run. |
static java.lang.String |
DBPOOL_IDLE_PERIOD
How long can connection sit in the pool before it is considered idle. |
static long |
DBPOOL_IDLE_PERIOD_DEFAULT
How long can connection sit in the pool before it is considered idle. |
static java.lang.String |
DBPOOL_INITIAL_SIZE
Initial size of the connection pool. |
static int |
DBPOOL_INITIAL_SIZE_DEFAULT
Initial size of the connection pool. |
static java.lang.String |
DBPOOL_MAX_SIZE
Maximal size of the connection pool. |
static int |
DBPOOL_MAX_SIZE_DEFAULT
Maximal size of the connection pool. |
static java.lang.String |
DBPOOL_MIN_SIZE
Minimal size of the connection pool. |
static int |
DBPOOL_MIN_SIZE_DEFAULT
Minimal size of the connection pool. |
static java.lang.String |
DBPOOL_PREPSTATEMENT_CACHE_SIZE
Should the connection pool cache prepared statements and if so how many. |
static int |
DBPOOL_PREPSTATEMENT_CACHE_SIZE_DEFAULT
Should the connection pool cache prepared statements and if so how many. |
static java.lang.String |
DBPOOL_RETRY_COUNT
If getting connection from the pool fails (e.g. |
static long |
DBPOOL_RETRY_COUNT_DEFAULT
If getting connection from the pool fails (e.g. |
static java.lang.String |
DBPOOL_RETRY_PERIOD
If getting connection from the pool fails (e.g. |
static long |
DBPOOL_RETRY_PERIOD_DEFAULT
If getting connection from the pool fails (e.g. |
static java.lang.String |
DBPOOL_TRANSACTION_ISOLATION
Default transaction isolation level. |
static java.lang.String |
DBPOOL_TRANSACTION_ISOLATION_DEFAULT
Default transaction isolation level. |
static java.lang.String |
DBPOOL_VALIDATE_BORROW
Should the pool validate connection immmediately before it is borrowed from the pool. |
static boolean |
DBPOOL_VALIDATE_BORROW_DEFAULT
Should the pool validate connection immmediately before it is borrowed from the pool. |
static java.lang.String |
DBPOOL_VALIDATE_IDLE
Should the pool validate connection when it is idle. |
static boolean |
DBPOOL_VALIDATE_IDLE_DEFAULT
Should the pool validate connection when it is idle. |
static java.lang.String |
DBPOOL_VALIDATE_RETURN
Should the pool validate connection when it is returned to the pool. |
static boolean |
DBPOOL_VALIDATE_RETURN_DEFAULT
Should the pool validate connection when it is returned to the pool. |
static java.lang.String |
DBPOOL_WAIT_PERIOD
If the pool should block when it reaches maximal size, how long can wait at most for a connection. |
static long |
DBPOOL_WAIT_PERIOD_DEFAULT
If the pool should block when it reaches maximal size, how long can wait at most for connection. |
protected static java.util.Map |
s_registeredParametersDefaults
Map with all registered paremeters names (as key) and default values (as String value) This map is common for all instances of class |
protected static java.util.Map |
s_registeredParametersTypes
Map with all registered paremeters names (as key) and types (as Integer value) This map is common for all instances of class |
| Constructor Summary | |
|---|---|
PooledDatabaseConnectionFactorySetupReader(java.lang.String readerName)
|
|
| Method Summary | |
|---|---|
static int |
convertTransactionIsolationToConstant(java.lang.String strTransactionIsolation)
Translate transaction isolation setting to a Connection.TRANSACTION_XXX constant. |
protected java.util.Map |
getRegisteredParametersDefaults()
this function returns Map for parameter defaults. |
protected java.util.Map |
getRegisteredParameterTypes()
this function returns Map for parameter types. |
protected void |
registerParameters()
Implementation can register all parameters in this function. |
| Methods inherited from class org.opensubsystems.core.util.SetupReader |
|---|
getBooleanParameterValue, getDoubleParameterValue, getFloatParameterValue, getIntegerParameterValue, getLongParameterValue, getParameterValue, getStringParameterValue, parseValue, registerParameter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DATABASE_POOL_BASE_PATH
public static final java.lang.String DBPOOL_INITIAL_SIZE
public static final java.lang.String DBPOOL_MIN_SIZE
public static final java.lang.String DBPOOL_MAX_SIZE
public static final java.lang.String DBPOOL_CAN_GROW
public static final java.lang.String DBPOOL_WAIT_PERIOD
public static final java.lang.String DBPOOL_RETRY_PERIOD
public static final java.lang.String DBPOOL_RETRY_COUNT
public static final java.lang.String DBPOOL_VALIDATE_BORROW
public static final java.lang.String DBPOOL_VALIDATE_RETURN
public static final java.lang.String DBPOOL_VALIDATE_IDLE
public static final java.lang.String DBPOOL_CHECK_LEVEL
public static final java.lang.String DBPOOL_IDLE_CHECK_PERIOD
public static final java.lang.String DBPOOL_IDLE_CHECK_SIZE
public static final java.lang.String DBPOOL_IDLE_PERIOD
public static final java.lang.String DBPOOL_TRANSACTION_ISOLATION
public static final java.lang.String DBPOOL_PREPSTATEMENT_CACHE_SIZE
public static final int DBPOOL_INITIAL_SIZE_DEFAULT
public static final int DBPOOL_MIN_SIZE_DEFAULT
public static final int DBPOOL_MAX_SIZE_DEFAULT
public static final boolean DBPOOL_CAN_GROW_DEFAULT
public static final long DBPOOL_WAIT_PERIOD_DEFAULT
public static final long DBPOOL_RETRY_PERIOD_DEFAULT
public static final long DBPOOL_RETRY_COUNT_DEFAULT
public static final boolean DBPOOL_VALIDATE_BORROW_DEFAULT
public static final boolean DBPOOL_VALIDATE_RETURN_DEFAULT
public static final boolean DBPOOL_VALIDATE_IDLE_DEFAULT
public static final int DBPOOL_CHECK_LEVEL_DEFAULT
public static final long DBPOOL_IDLE_CHECK_PERIOD_DEFAULT
public static final int DBPOOL_IDLE_CHECK_SIZE_DEFAULT
public static final long DBPOOL_IDLE_PERIOD_DEFAULT
public static final java.lang.String DBPOOL_TRANSACTION_ISOLATION_DEFAULT
public static final int DBPOOL_PREPSTATEMENT_CACHE_SIZE_DEFAULT
protected static java.util.Map s_registeredParametersTypes
protected static java.util.Map s_registeredParametersDefaults
| Constructor Detail |
|---|
public PooledDatabaseConnectionFactorySetupReader(java.lang.String readerName)
readerName - - name of reader
Each property name consist from three parts. base path,
reader name and parameter name. Property name looks like | Method Detail |
|---|
protected void registerParameters()
registerParameters in class SetupReaderprotected java.util.Map getRegisteredParameterTypes()
getRegisteredParameterTypes in class SetupReaderprotected java.util.Map getRegisteredParametersDefaults()
getRegisteredParametersDefaults in class SetupReaderpublic static int convertTransactionIsolationToConstant(java.lang.String strTransactionIsolation)
strTransactionIsolation - - one of the settings to set transaction isolation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||