public class BoneCPConfig extends Object implements BoneCPConfigMBean, Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Properties |
driverProperties
Used when the alternate way of obtaining a connection is required
|
| Constructor and Description |
|---|
BoneCPConfig()
Default constructor.
|
BoneCPConfig(InputStream xmlConfigFile,
String sectionName)
Initialise the configuration by loading an XML file containing the settings.
|
BoneCPConfig(Properties props)
Creates a new config using the given properties.
|
BoneCPConfig(String sectionName)
Initialize the configuration by loading bonecp-config.xml containing the settings.
|
| Modifier and Type | Method and Description |
|---|---|
BoneCPConfig |
clone() |
int |
getAcquireIncrement()
Gets the acquireIncrement property.
|
int |
getAcquireRetryAttempts()
After attempting to acquire a connection and failing, try to connect these many times before giving up.
|
long |
getAcquireRetryDelay()
Deprecated.
Use
getAcquireRetryDelayInMs() instead. |
long |
getAcquireRetryDelay(TimeUnit timeUnit)
Returns the acquireRetryDelay setting with the specified granularity.
|
long |
getAcquireRetryDelayInMs()
Returns the number of ms to wait before attempting to obtain a connection again after a failure.
|
ClassLoader |
getClassLoader()
Returns the currently active classloader.
|
Properties |
getClientInfo()
Returns the clientInfo field.
|
long |
getCloseConnectionWatchTimeout()
Deprecated.
Use
getCloseConnectionWatchTimeoutInMs() instead |
long |
getCloseConnectionWatchTimeout(TimeUnit timeUnit)
Returns the closeConnectionWatchTimeout with the specified granularity.
|
long |
getCloseConnectionWatchTimeoutInMs()
Returns the no of ms to wait when close connection watch threads are enabled.
|
String |
getConfigFile()
Returns the configFile field.
|
ConnectionHook |
getConnectionHook()
Returns the connection hook class.
|
String |
getConnectionHookClassName()
Returns the connection hook class name as passed via the setter
|
String |
getConnectionTestStatement()
Gets connectionTestStatement
|
long |
getConnectionTimeout()
Deprecated.
Use
getConnectionTimeoutInMs() instead. |
long |
getConnectionTimeout(TimeUnit timeUnit)
Returns the connectionTimeout with the specified granularity.
|
long |
getConnectionTimeoutInMs()
Returns the maximum time (in milliseconds) to wait before a call to getConnection is timed out.
|
DataSource |
getDatasourceBean()
Returns the bean being used to return a connection.
|
boolean |
getDefaultAutoCommit()
Returns the defaultAutoCommit field.
|
String |
getDefaultCatalog()
Returns the defaultCatalog field.
|
Boolean |
getDefaultReadOnly()
Returns the defaultReadOnly field.
|
String |
getDefaultTransactionIsolation()
Returns the defaultTransactionIsolation field.
|
protected int |
getDefaultTransactionIsolationValue()
Returns the defaultTransactionIsolationValue field.
|
Properties |
getDriverProperties()
Returns the currently configured driver properties.
|
long |
getIdleConnectionTestPeriod()
Deprecated.
Please use
getIdleConnectionTestPeriodInMinutes() instead. |
long |
getIdleConnectionTestPeriod(TimeUnit timeUnit)
Returns the idleConnectionTestPeriod with the specified granularity.
|
long |
getIdleConnectionTestPeriodInMinutes()
Gets the currently set idleConnectionTestPeriodInMinutes.
|
long |
getIdleMaxAge()
Deprecated.
Use
getIdleMaxAgeInMinutes() instead |
long |
getIdleMaxAge(TimeUnit timeUnit)
Returns the idleMaxAge with the specified granularity.
|
long |
getIdleMaxAgeInMinutes()
Returns the idleMaxAge currently set.
|
String |
getInitSQL()
Returns the initSQL parameter.
|
String |
getJdbcUrl()
Gets the configured JDBC URL
|
long |
getMaxConnectionAge()
Deprecated.
Please use
getMaxConnectionAgeInSeconds() instead. |
long |
getMaxConnectionAge(TimeUnit timeUnit)
Returns the maxConnectionAge with the specified granularity.
|
long |
getMaxConnectionAgeInSeconds()
Returns the maxConnectionAge field in seconds
|
int |
getMaxConnectionsPerPartition()
Gets the maximum number of connections that will be contained in every partition.
|
int |
getMinConnectionsPerPartition()
Gets the minimum number of connections that will be contained in every partition.
|
int |
getPartitionCount()
Gets the number of currently defined partitions.
|
String |
getPassword()
Gets password to use for connections
|
int |
getPoolAvailabilityThreshold()
Returns the pool watch connection threshold value.
|
String |
getPoolName()
Returns the name of the pool for JMX and thread names.
|
String |
getPoolStrategy()
Returns the poolStrategy field.
|
int |
getPreparedStatementCacheSize()
Deprecated.
|
int |
getPreparedStatementsCacheSize()
Deprecated.
|
long |
getQueryExecuteTimeLimit()
Deprecated.
Use
getQueryExecuteTimeLimitInMs() instead. |
long |
getQueryExecuteTimeLimit(TimeUnit timeUnit)
Returns the queryExecuteTimeLimit setting with the specified granularity.
|
long |
getQueryExecuteTimeLimitInMs()
Return the query execute time limit.
|
int |
getReleaseHelperThreads()
Deprecated.
|
String |
getServiceOrder()
Returns the serviceOrder field.
|
int |
getStatementCacheSize()
Deprecated.
|
int |
getStatementReleaseHelperThreads()
Deprecated.
|
int |
getStatementsCachedPerConnection()
Deprecated.
|
int |
getStatementsCacheSize()
Gets statementsCacheSize setting.
|
String |
getUser()
Just delegates to getUsername for clients hardcoded to "getUser".
|
String |
getUsername()
Gets username to use for the connections.
|
boolean |
hasSameConfiguration(BoneCPConfig that)
Returns true if this instance has the same config as a given config.
|
boolean |
isCloseConnectionWatch()
Returns if BoneCP is configured to create a helper thread to watch over connection acquires that are never released (or released
twice).
|
boolean |
isCloseOpenStatements()
Returns the closeOpenStatements field.
|
boolean |
isDeregisterDriverOnClose()
Returns the deregisterDriverOnClose setting.
|
boolean |
isDetectUnclosedStatements()
Returns the detectUnclosedStatements field.
|
boolean |
isDetectUnresolvedTransactions()
Returns the detectUnresolvedTransactions field.
|
boolean |
isDisableConnectionTracking()
Returns true if connection tracking has been disabled.
|
boolean |
isDisableJMX()
Return true if JMX is disabled.
|
boolean |
isExternalAuth()
Returns the current externalAuth setting.
|
boolean |
isLazyInit()
Returns true if connection pool is to be initialized lazily.
|
boolean |
isLogStatementsEnabled()
Returns true if SQL logging is currently enabled, false otherwise.
|
boolean |
isNullOnConnectionTimeout()
Returns the nullOnConnectionTimeout field.
|
boolean |
isResetConnectionOnClose()
Returns the resetConnectionOnClose setting.
|
boolean |
isStatisticsEnabled()
Returns the statisticsEnabled field.
|
boolean |
isTransactionRecoveryEnabled()
Returns true if the pool is configured to record all transaction activity and replay the transaction automatically in case
of connection failures.
|
protected Class<?> |
loadClass(String clazz)
Loads the given class, respecting the given classloader.
|
protected void |
loadProperties(String filename)
Loads the given properties file using the classloader.
|
void |
sanitize()
Performs validation on the config object.
|
void |
setAcquireIncrement(int acquireIncrement)
Sets the acquireIncrement property.
|
void |
setAcquireRetryAttempts(int acquireRetryAttempts)
After attempting to acquire a connection and failing, try to connect these many times before giving up.
|
void |
setAcquireRetryDelay(int acquireRetryDelayInMs)
Deprecated.
|
void |
setAcquireRetryDelay(long acquireRetryDelay,
TimeUnit timeUnit)
Sets the number of ms to wait before attempting to obtain a connection again after a failure.
|
void |
setAcquireRetryDelayInMs(long acquireRetryDelay)
Sets the number of ms to wait before attempting to obtain a connection again after a failure.
|
void |
setClassLoader(ClassLoader classLoader)
Sets the classloader to use to load JDBC driver and hooks (set to null to use default).
|
void |
setClientInfo(Properties properties)
If set, pool will call this for every new connection that's created.
|
void |
setCloseConnectionWatch(boolean closeConnectionWatch)
Instruct the pool to create a helper thread to watch over connection acquires that are never released (or released twice).
|
void |
setCloseConnectionWatchTimeout(long closeConnectionWatchTimeout)
Deprecated.
Use
setCloseConnectionWatchTimeoutInMs(long) instead |
void |
setCloseConnectionWatchTimeout(long closeConnectionWatchTimeout,
TimeUnit timeUnit)
Sets the time to wait when close connection watch threads are enabled.
|
void |
setCloseConnectionWatchTimeoutInMs(long closeConnectionWatchTimeout)
Sets the no of ms to wait when close connection watch threads are enabled.
|
void |
setCloseOpenStatements(boolean closeOpenStatements)
If true, track statements and close them if application forgot to do so.
|
void |
setConfigFile(String configFile)
Sets the configFile.
|
void |
setConnectionHook(ConnectionHook connectionHook)
Sets the connection hook.
|
void |
setConnectionHookClassName(String connectionHookClassName)
Sets the connection hook class name.
|
void |
setConnectionTestStatement(String connectionTestStatement)
Sets the connection test statement.
|
void |
setConnectionTimeout(long connectionTimeout)
Deprecated.
Use
setConnectionTimeoutInMs(long) instead. |
void |
setConnectionTimeout(long connectionTimeout,
TimeUnit timeUnit)
Sets the maximum time to wait before a call to getConnection is timed out.
|
void |
setConnectionTimeoutInMs(long connectionTimeoutinMs)
Sets the maximum time (in milliseconds) to wait before a call to getConnection is timed out.
|
void |
setDatasourceBean(DataSource datasourceBean)
If set, use datasourceBean.getConnection() to obtain a new connection instead of Driver.getConnection().
|
void |
setDefaultAutoCommit(boolean defaultAutoCommit)
Sets the defaultAutoCommit setting for newly created connections.
|
void |
setDefaultCatalog(String defaultCatalog)
Sets the defaultCatalog setting for newly created connections.
|
void |
setDefaultReadOnly(Boolean defaultReadOnly)
Sets the defaultReadOnly setting for newly created connections.
|
void |
setDefaultTransactionIsolation(String defaultTransactionIsolation)
Sets the defaultTransactionIsolation.
|
protected void |
setDefaultTransactionIsolationValue(int defaultTransactionIsolationValue)
Sets the defaultTransactionIsolationValue.
|
void |
setDeregisterDriverOnClose(boolean deregisterDriverOnClose)
If set to true, try to unregister the JDBC driver when pool is shutdown.
|
void |
setDetectUnclosedStatements(boolean detectUnclosedStatements)
Sets the detectUnclosedStatements.
|
void |
setDetectUnresolvedTransactions(boolean detectUnresolvedTransactions)
If true, and resetConnectionOnClose is also true, the pool will print out a stack
trace of the location where you had a connection that specified setAutoCommit(false)
but then forgot to call commit/rollback before closing it off.
|
void |
setDisableConnectionTracking(boolean disableConnectionTracking)
If set to true, the pool will not monitor connections for proper closure.
|
void |
setDisableJMX(boolean disableJMX)
Set to true to disable JMX.
|
void |
setDriverProperties(Properties driverProperties)
Sets properties that will be passed on to the driver.
|
void |
setExternalAuth(boolean externalAuth)
If set to true, no attempts at passing in a username/password will be attempted
when trying to obtain a raw (driver) connection.
|
void |
setIdleConnectionTestPeriod(long idleConnectionTestPeriod)
Deprecated.
Please use
setIdleConnectionTestPeriodInMinutes(long) or setIdleConnectionTestPeriod(long, TimeUnit) instead |
void |
setIdleConnectionTestPeriod(long idleConnectionTestPeriod,
TimeUnit timeUnit)
Wrapper method for idleConnectionTestPeriod for easier programmatic access.
|
void |
setIdleConnectionTestPeriodInMinutes(long idleConnectionTestPeriod)
Sets the idleConnectionTestPeriod.
|
void |
setIdleConnectionTestPeriodInSeconds(long idleConnectionTestPeriod)
Sets the idleConnectionTestPeriod.
|
void |
setIdleMaxAge(long idleMaxAge)
Deprecated.
Use
setIdleMaxAgeInMinutes(long) or setIdleMaxAge(long, TimeUnit) instead. |
void |
setIdleMaxAge(long idleMaxAge,
TimeUnit timeUnit)
Sets Idle max age.
|
void |
setIdleMaxAgeInMinutes(long idleMaxAge)
Sets Idle max age (in min).
|
void |
setIdleMaxAgeInSeconds(long idleMaxAge)
Sets Idle max age (in seconds).
|
void |
setInitSQL(String initSQL)
Specifies an initial SQL statement that is run only when a connection is first created.
|
void |
setJdbcUrl(String jdbcUrl)
Sets the JDBC connection URL.
|
void |
setLazyInit(boolean lazyInit)
Set to true to force the connection pool to obtain the initial connections lazily.
|
void |
setLogStatementsEnabled(boolean logStatementsEnabled)
If enabled, log SQL statements being executed.
|
void |
setMaxConnectionAge(long maxConnectionAgeInSeconds)
Deprecated.
Please use {
setMaxConnectionAgeInSeconds(long) instead. |
void |
setMaxConnectionAge(long maxConnectionAge,
TimeUnit timeUnit)
Sets the maxConnectionAge.
|
void |
setMaxConnectionAgeInSeconds(long maxConnectionAgeInSeconds)
Sets the maxConnectionAge in seconds.
|
void |
setMaxConnectionsPerPartition(int maxConnectionsPerPartition)
Sets the maximum number of connections that will be contained in every partition.
|
void |
setMinConnectionsPerPartition(int minConnectionsPerPartition)
Sets the minimum number of connections that will be contained in every partition.
|
void |
setNullOnConnectionTimeout(boolean nullOnConnectionTimeout)
Sets the nullOnConnectionTimeout.
|
void |
setPartitionCount(int partitionCount)
Sets number of partitions to use.
|
void |
setPassword(String password)
Sets password to use for connections.
|
void |
setPoolAvailabilityThreshold(int poolAvailabilityThreshold)
Sets the Pool Watch thread threshold.
|
void |
setPoolName(String poolName)
Sets the name of the pool for JMX and thread names.
|
void |
setPoolStrategy(String poolStrategy)
Sets the poolStrategy.
|
void |
setPreparedStatementsCacheSize(int preparedStatementsCacheSize)
Deprecated.
|
void |
setProperties(Properties props)
Sets the properties by reading off entries in the given parameter (where each key is equivalent to the field name)
|
void |
setQueryExecuteTimeLimit(int queryExecuteTimeLimit)
Deprecated.
Use
setQueryExecuteTimeLimitInMs(long) instead. |
void |
setQueryExecuteTimeLimit(long queryExecuteTimeLimit,
TimeUnit timeUnit)
Queries taking longer than this limit to execute are logged.
|
void |
setQueryExecuteTimeLimitInMs(long queryExecuteTimeLimit)
Queries taking longer than this limit to execute are logged.
|
void |
setReleaseHelperThreads(int releaseHelperThreads)
Deprecated.
|
void |
setResetConnectionOnClose(boolean resetConnectionOnClose)
If true, issue a reset (rollback) on connection close in case client forgot it.
|
void |
setServiceOrder(String serviceOrder)
Sets the queue serviceOrder.
|
void |
setStatementCacheSize(int statementsCacheSize)
Deprecated.
|
void |
setStatementReleaseHelperThreads(int statementReleaseHelperThreads)
Deprecated.
|
void |
setStatementsCachedPerConnection(int statementsCachedPerConnection)
Deprecated.
|
void |
setStatementsCacheSize(int statementsCacheSize)
Sets statementsCacheSize setting.
|
void |
setStatisticsEnabled(boolean statisticsEnabled)
If set to true, keep track of some more statistics for exposure via JMX.
|
void |
setTransactionRecoveryEnabled(boolean transactionRecoveryEnabled)
Set to true to enable recording of all transaction activity and replay the transaction automatically in case
of a connection failure.
|
void |
setUser(String username)
Sets username to use for connections.
|
void |
setUsername(String username)
Sets username to use for connections.
|
String |
toString() |
protected Properties driverProperties
public BoneCPConfig()
public BoneCPConfig(Properties props) throws Exception
props - properties to set.Exception - on errorpublic BoneCPConfig(String sectionName) throws Exception
sectionName - section to loadException - on parse errorspublic BoneCPConfig(InputStream xmlConfigFile, String sectionName) throws Exception
xmlConfigFile - file to loadsectionName - section to loadExceptionpublic String getPoolName()
getPoolName in interface BoneCPConfigMBeanpublic void setPoolName(String poolName)
poolName - to set.public int getMinConnectionsPerPartition()
getMinConnectionsPerPartition in interface BoneCPConfigMBeanBoneCPConfigMBean.getMinConnectionsPerPartition()public void setMinConnectionsPerPartition(int minConnectionsPerPartition)
setPoolAvailabilityThreshold(int).minConnectionsPerPartition - number of connectionspublic int getMaxConnectionsPerPartition()
getMaxConnectionsPerPartition in interface BoneCPConfigMBeanBoneCPConfigMBean.getMaxConnectionsPerPartition()public void setMaxConnectionsPerPartition(int maxConnectionsPerPartition)
maxConnectionsPerPartition - number of connections.public int getAcquireIncrement()
getAcquireIncrement in interface BoneCPConfigMBeanBoneCPConfigMBean.getAcquireIncrement()public void setAcquireIncrement(int acquireIncrement)
Note: This is a per partition setting.
acquireIncrement - value to set.public int getPartitionCount()
getPartitionCount in interface BoneCPConfigMBeanBoneCPConfigMBean.getPartitionCount()public void setPartitionCount(int partitionCount)
Default: 1, minimum: 1, recommended: 2-4 (but very app specific)
partitionCount - to setpublic String getJdbcUrl()
getJdbcUrl in interface BoneCPConfigMBeanBoneCPConfigMBean.getJdbcUrl()public void setJdbcUrl(String jdbcUrl)
jdbcUrl - to setpublic String getUsername()
getUsername in interface BoneCPConfigMBeanBoneCPConfigMBean.getUsername()public void setUsername(String username)
username - to setpublic void setUser(String username)
username - to setpublic String getUser()
public String getPassword()
public void setPassword(String password)
password - to set.@Deprecated public long getIdleConnectionTestPeriod()
getIdleConnectionTestPeriodInMinutes() instead.@Deprecated public void setIdleConnectionTestPeriod(long idleConnectionTestPeriod)
setIdleConnectionTestPeriodInMinutes(long) or setIdleConnectionTestPeriod(long, TimeUnit) insteadidleConnectionTestPeriod - to set in minutespublic long getIdleConnectionTestPeriodInMinutes()
getIdleConnectionTestPeriodInMinutes in interface BoneCPConfigMBeanBoneCPConfigMBean.getIdleConnectionTestPeriodInMinutes()public long getIdleConnectionTestPeriod(TimeUnit timeUnit)
timeUnit - time granularitypublic void setIdleConnectionTestPeriodInMinutes(long idleConnectionTestPeriod)
Default: 240 min, set to 0 to disable
idleConnectionTestPeriod - to setpublic void setIdleConnectionTestPeriodInSeconds(long idleConnectionTestPeriod)
Default: 240 min, set to 0 to disable
idleConnectionTestPeriod - to setpublic void setIdleConnectionTestPeriod(long idleConnectionTestPeriod,
TimeUnit timeUnit)
idleConnectionTestPeriod - time for a connection to remain idle before sending a test
query to the DB.timeUnit - Time granularity of given parameter.@Deprecated public long getIdleMaxAge()
getIdleMaxAgeInMinutes() insteadpublic long getIdleMaxAge(TimeUnit timeUnit)
timeUnit - time granularitypublic long getIdleMaxAgeInMinutes()
getIdleMaxAgeInMinutes in interface BoneCPConfigMBean@Deprecated public void setIdleMaxAge(long idleMaxAge)
idleMaxAge - to setpublic void setIdleMaxAgeInMinutes(long idleMaxAge)
Default: 60 minutes, set to 0 to disable.
idleMaxAge - to setpublic void setIdleMaxAgeInSeconds(long idleMaxAge)
Default: 60 minutes, set to 0 to disable.
idleMaxAge - to setpublic void setIdleMaxAge(long idleMaxAge,
TimeUnit timeUnit)
idleMaxAge - time after which a connection is closed offtimeUnit - idleMaxAge time granularity.public String getConnectionTestStatement()
getConnectionTestStatement in interface BoneCPConfigMBeanBoneCPConfigMBean.getConnectionTestStatement()public void setConnectionTestStatement(String connectionTestStatement)
Default: Use metadata request
connectionTestStatement - to set.@Deprecated public int getPreparedStatementsCacheSize()
@Deprecated public int getPreparedStatementCacheSize()
@Deprecated public void setPreparedStatementsCacheSize(int preparedStatementsCacheSize)
preparedStatementsCacheSize - to set.public void setStatementsCacheSize(int statementsCacheSize)
statementsCacheSize - to set.public int getStatementsCacheSize()
getStatementsCacheSize in interface BoneCPConfigMBeanBoneCPConfigMBean.getStatementsCacheSize()@Deprecated public void setStatementCacheSize(int statementsCacheSize)
statementsCacheSize - to set.@Deprecated public int getStatementCacheSize()
@Deprecated public int getReleaseHelperThreads()
getReleaseHelperThreads in interface BoneCPConfigMBeanBoneCPConfigMBean.getReleaseHelperThreads()@Deprecated public void setReleaseHelperThreads(int releaseHelperThreads)
releaseHelperThreads - no to release@Deprecated public int getStatementsCachedPerConnection()
getStatementsCachedPerConnection in interface BoneCPConfigMBeanBoneCPConfigMBean.getStatementsCachedPerConnection()@Deprecated public void setStatementsCachedPerConnection(int statementsCachedPerConnection)
statementsCachedPerConnection - to setpublic ConnectionHook getConnectionHook()
getConnectionHook in interface BoneCPConfigMBeanBoneCPConfigMBean.getConnectionHook()public void setConnectionHook(ConnectionHook connectionHook)
connectionHook - the connectionHook to setpublic String getInitSQL()
getInitSQL in interface BoneCPConfigMBeanBoneCPConfigMBean.getInitSQL()public void setInitSQL(String initSQL)
initSQL - the initSQL to setpublic boolean isCloseConnectionWatch()
public void setCloseConnectionWatch(boolean closeConnectionWatch)
closeConnectionWatch - set to true to enable thread monitoring.public boolean isLogStatementsEnabled()
isLogStatementsEnabled in interface BoneCPConfigMBeanpublic void setLogStatementsEnabled(boolean logStatementsEnabled)
logStatementsEnabled - the logStatementsEnabled to set@Deprecated public long getAcquireRetryDelay()
getAcquireRetryDelayInMs() instead.@Deprecated public void setAcquireRetryDelay(int acquireRetryDelayInMs)
setAcquireRetryDelayInMs(long).acquireRetryDelayInMs - the acquireRetryDelay to setpublic long getAcquireRetryDelayInMs()
getAcquireRetryDelayInMs in interface BoneCPConfigMBeanpublic long getAcquireRetryDelay(TimeUnit timeUnit)
timeUnit - time granularitypublic void setAcquireRetryDelayInMs(long acquireRetryDelay)
acquireRetryDelay - the acquireRetryDelay to setpublic void setAcquireRetryDelay(long acquireRetryDelay,
TimeUnit timeUnit)
acquireRetryDelay - the acquireRetryDelay to settimeUnit - time granularitypublic boolean isLazyInit()
isLazyInit in interface BoneCPConfigMBeanpublic void setLazyInit(boolean lazyInit)
lazyInit - the lazyInit setting to setpublic boolean isTransactionRecoveryEnabled()
isTransactionRecoveryEnabled in interface BoneCPConfigMBeanpublic void setTransactionRecoveryEnabled(boolean transactionRecoveryEnabled)
transactionRecoveryEnabled - the transactionRecoveryEnabled status to setpublic int getAcquireRetryAttempts()
getAcquireRetryAttempts in interface BoneCPConfigMBeanpublic void setAcquireRetryAttempts(int acquireRetryAttempts)
acquireRetryAttempts - the acquireRetryAttempts to setpublic void setConnectionHookClassName(String connectionHookClassName)
connectionHookClassName - the connectionHook class name to setpublic String getConnectionHookClassName()
getConnectionHookClassName in interface BoneCPConfigMBeanpublic boolean isDisableJMX()
isDisableJMX in interface BoneCPConfigMBeanpublic void setDisableJMX(boolean disableJMX)
disableJMX - the disableJMX to setpublic DataSource getDatasourceBean()
public void setDatasourceBean(DataSource datasourceBean)
datasourceBean - the datasourceBean to set@Deprecated public long getQueryExecuteTimeLimit()
getQueryExecuteTimeLimitInMs() instead.@Deprecated public void setQueryExecuteTimeLimit(int queryExecuteTimeLimit)
setQueryExecuteTimeLimitInMs(long) instead.queryExecuteTimeLimit - the limit to set in milliseconds.public long getQueryExecuteTimeLimitInMs()
getQueryExecuteTimeLimitInMs in interface BoneCPConfigMBeanpublic long getQueryExecuteTimeLimit(TimeUnit timeUnit)
timeUnit - time granularitypublic void setQueryExecuteTimeLimitInMs(long queryExecuteTimeLimit)
queryExecuteTimeLimit - the limit to set in milliseconds.public void setQueryExecuteTimeLimit(long queryExecuteTimeLimit,
TimeUnit timeUnit)
queryExecuteTimeLimit - the limit to set in milliseconds.timeUnit - public int getPoolAvailabilityThreshold()
getPoolAvailabilityThreshold in interface BoneCPConfigMBeanpublic void setPoolAvailabilityThreshold(int poolAvailabilityThreshold)
poolAvailabilityThreshold - the poolAvailabilityThreshold to setpublic boolean isDisableConnectionTracking()
isDisableConnectionTracking in interface BoneCPConfigMBeanpublic void setDisableConnectionTracking(boolean disableConnectionTracking)
disableConnectionTracking - set to true to disable. Default: false.@Deprecated public long getConnectionTimeout()
getConnectionTimeoutInMs() instead.@Deprecated public void setConnectionTimeout(long connectionTimeout)
setConnectionTimeoutInMs(long) instead.connectionTimeout - the connectionTimeout to setpublic long getConnectionTimeoutInMs()
getConnectionTimeoutInMs in interface BoneCPConfigMBeanpublic long getConnectionTimeout(TimeUnit timeUnit)
timeUnit - time granularitypublic void setConnectionTimeoutInMs(long connectionTimeoutinMs)
connectionTimeoutinMs - the connectionTimeout to setpublic void setConnectionTimeout(long connectionTimeout,
TimeUnit timeUnit)
connectionTimeout - timeUnit - the unit of the connectionTimeout argumentpublic Properties getDriverProperties()
public void setDriverProperties(Properties driverProperties)
driverProperties - the driverProperties to set@Deprecated public long getCloseConnectionWatchTimeout()
getCloseConnectionWatchTimeoutInMs() instead@Deprecated public void setCloseConnectionWatchTimeout(long closeConnectionWatchTimeout)
setCloseConnectionWatchTimeoutInMs(long) insteadcloseConnectionWatchTimeout - the watchTimeout to setpublic long getCloseConnectionWatchTimeoutInMs()
getCloseConnectionWatchTimeoutInMs in interface BoneCPConfigMBeanpublic long getCloseConnectionWatchTimeout(TimeUnit timeUnit)
timeUnit - time granularitypublic void setCloseConnectionWatchTimeoutInMs(long closeConnectionWatchTimeout)
closeConnectionWatchTimeout - the watchTimeout to setpublic void setCloseConnectionWatchTimeout(long closeConnectionWatchTimeout,
TimeUnit timeUnit)
closeConnectionWatchTimeout - the watchTimeout to settimeUnit - Time granularity@Deprecated public int getStatementReleaseHelperThreads()
getStatementReleaseHelperThreads in interface BoneCPConfigMBean@Deprecated public void setStatementReleaseHelperThreads(int statementReleaseHelperThreads)
statementReleaseHelperThreads - no to release@Deprecated public long getMaxConnectionAge()
getMaxConnectionAgeInSeconds() instead.getMaxConnectionAgeInSeconds() instead.public long getMaxConnectionAgeInSeconds()
getMaxConnectionAgeInSeconds in interface BoneCPConfigMBeanpublic long getMaxConnectionAge(TimeUnit timeUnit)
timeUnit - time granularity@Deprecated public void setMaxConnectionAge(long maxConnectionAgeInSeconds)
setMaxConnectionAgeInSeconds(long) instead.setMaxConnectionAgeInSeconds(long) instead.maxConnectionAgeInSeconds - the maxConnectionAge to setpublic void setMaxConnectionAgeInSeconds(long maxConnectionAgeInSeconds)
maxConnectionAgeInSeconds - the maxConnectionAge to setpublic void setMaxConnectionAge(long maxConnectionAge,
TimeUnit timeUnit)
maxConnectionAge - the maxConnectionAge to set.timeUnit - the unit of the maxConnectionAge argument.public String getConfigFile()
getConfigFile in interface BoneCPConfigMBeanpublic void setConfigFile(String configFile)
configFile - the configFile to setpublic String getServiceOrder()
getServiceOrder in interface BoneCPConfigMBeanpublic void setServiceOrder(String serviceOrder)
serviceOrder - the serviceOrder to setpublic boolean isStatisticsEnabled()
isStatisticsEnabled in interface BoneCPConfigMBeanpublic void setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled - set to true to enablepublic boolean getDefaultAutoCommit()
public void setDefaultAutoCommit(boolean defaultAutoCommit)
defaultAutoCommit - the defaultAutoCommit to setpublic Boolean getDefaultReadOnly()
public void setDefaultReadOnly(Boolean defaultReadOnly)
defaultReadOnly - the defaultReadOnly to setpublic String getDefaultCatalog()
public void setDefaultCatalog(String defaultCatalog)
defaultCatalog - the defaultCatalog to setpublic String getDefaultTransactionIsolation()
public void setDefaultTransactionIsolation(String defaultTransactionIsolation)
defaultTransactionIsolation - the defaultTransactionIsolation to setprotected int getDefaultTransactionIsolationValue()
protected void setDefaultTransactionIsolationValue(int defaultTransactionIsolationValue)
defaultTransactionIsolationValue - the defaultTransactionIsolationValue to setpublic void setProperties(Properties props) throws Exception
props - Parameter list to setException - on errorpublic boolean isExternalAuth()
public void setExternalAuth(boolean externalAuth)
externalAuth - True to enable external auth.public void sanitize()
protected void loadProperties(String filename)
filename - Config filename to loadprotected Class<?> loadClass(String clazz) throws ClassNotFoundException
clazz - class to loadClassNotFoundExceptionpublic ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
classLoader - the classLoader to setpublic BoneCPConfig clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic boolean hasSameConfiguration(BoneCPConfig that)
that - public boolean isDeregisterDriverOnClose()
public void setDeregisterDriverOnClose(boolean deregisterDriverOnClose)
deregisterDriverOnClose - the deregisterDriverOnClose setting.public boolean isNullOnConnectionTimeout()
public void setNullOnConnectionTimeout(boolean nullOnConnectionTimeout)
nullOnConnectionTimeout - the nullOnConnectionTimeout to setpublic boolean isResetConnectionOnClose()
public void setResetConnectionOnClose(boolean resetConnectionOnClose)
resetConnectionOnClose - the resetConnectionOnClose to setpublic boolean isDetectUnresolvedTransactions()
public void setDetectUnresolvedTransactions(boolean detectUnresolvedTransactions)
detectUnresolvedTransactions - the detectUnresolvedTransactions to setpublic String getPoolStrategy()
public void setPoolStrategy(String poolStrategy)
poolStrategy - the poolStrategy to setpublic boolean isCloseOpenStatements()
public void setCloseOpenStatements(boolean closeOpenStatements)
detectUnclosedStatements. Do not set if your connections are managed
eg via Spring jdbcTemplate or hibernate since those frameworks will always automatically
close off your statements. This option has a negative performance hit.closeOpenStatements - the closeOpenStatements to setpublic boolean isDetectUnclosedStatements()
public void setDetectUnclosedStatements(boolean detectUnclosedStatements)
closeOpenStatements.detectUnclosedStatements - the detectUnclosedStatements to setpublic void setClientInfo(Properties properties)
properties - Properties to set.public Properties getClientInfo()
Copyright © 2009-2013 JolBox. All Rights Reserved.