Package net.ontopia.persistence.proxy
Class DBCPDataSource
- java.lang.Object
-
- org.apache.commons.dbcp2.PoolingDataSource<org.apache.commons.dbcp2.PoolableConnection>
-
- net.ontopia.persistence.proxy.DBCPDataSource
-
- All Implemented Interfaces:
AutoCloseable,Wrapper,CommonDataSource,DataSource,InstrumentedDataSourceIF
public class DBCPDataSource extends org.apache.commons.dbcp2.PoolingDataSource<org.apache.commons.dbcp2.PoolableConnection> implements InstrumentedDataSourceIF
INTERNAL: A datasource wrapping the DBCP2 connection pooling. Uses bean-utils to populate the settings, see the specific config documentation for all possible options.- Since:
- 5.5.0
- See Also:
AbandonedConfig,GenericObjectPoolConfig
-
-
Field Summary
Fields Modifier and Type Field Description static StringABANDONstatic intDEFAULT_ABANDON_TIMEOUTstatic intDEFAULT_IDLE_TIMEOUTstatic intDEFAULT_MAX_ACTIVEstatic intDEFAULT_MAX_IDLEstatic intDEFAULT_MIN_IDLEstatic intDEFAULT_USER_TIMEOUTstatic StringDEFAULT_VALIDATION_QUERYstatic intDEFAULT_VALIDATION_TIMEOUTstatic StringPOOLstatic StringRDBMS_CONNECTION_STRINGstatic StringRDBMS_DRIVERstatic StringRDBMS_PASSWORDstatic StringRDBMS_USERNAMEstatic StringVALIDATION_QUERYstatic StringVALIDATION_QUERY_TIMEOUT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DBCPDataSourcefromConfiguration(Map<String,String> properties)longgetConnectionsBorrowed()longgetConnectionsClosed()longgetConnectionsClosedByEviction()longgetConnectionsClosedByValidation()longgetConnectionsOpened()longgetConnectionsReturned()intgetMaxIdle()intgetMaxTotal()intgetMinIdle()intgetNumActive()intgetNumIdle()-
Methods inherited from class org.apache.commons.dbcp2.PoolingDataSource
close, getConnection, getConnection, getLoginTimeout, getLogWriter, getParentLogger, getPool, isAccessToUnderlyingConnectionAllowed, isWrapperFor, setAccessToUnderlyingConnectionAllowed, setLoginTimeout, setLogWriter, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
-
-
-
Field Detail
-
RDBMS_DRIVER
public static final String RDBMS_DRIVER
- See Also:
- Constant Field Values
-
RDBMS_CONNECTION_STRING
public static final String RDBMS_CONNECTION_STRING
- See Also:
- Constant Field Values
-
RDBMS_USERNAME
public static final String RDBMS_USERNAME
- See Also:
- Constant Field Values
-
RDBMS_PASSWORD
public static final String RDBMS_PASSWORD
- See Also:
- Constant Field Values
-
VALIDATION_QUERY
public static final String VALIDATION_QUERY
- See Also:
- Constant Field Values
-
POOL
public static final String POOL
- See Also:
- Constant Field Values
-
ABANDON
public static final String ABANDON
- See Also:
- Constant Field Values
-
VALIDATION_QUERY_TIMEOUT
public static final String VALIDATION_QUERY_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_VALIDATION_TIMEOUT
public static final int DEFAULT_VALIDATION_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_VALIDATION_QUERY
public static final String DEFAULT_VALIDATION_QUERY
- See Also:
- Constant Field Values
-
DEFAULT_USER_TIMEOUT
public static final int DEFAULT_USER_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_MIN_IDLE
public static final int DEFAULT_MIN_IDLE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_IDLE
public static final int DEFAULT_MAX_IDLE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_ACTIVE
public static final int DEFAULT_MAX_ACTIVE
- See Also:
- Constant Field Values
-
DEFAULT_IDLE_TIMEOUT
public static final int DEFAULT_IDLE_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_ABANDON_TIMEOUT
public static final int DEFAULT_ABANDON_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromConfiguration
public static DBCPDataSource fromConfiguration(Map<String,String> properties)
-
getConnectionsClosed
public long getConnectionsClosed()
- Specified by:
getConnectionsClosedin interfaceInstrumentedDataSourceIF
-
getConnectionsOpened
public long getConnectionsOpened()
- Specified by:
getConnectionsOpenedin interfaceInstrumentedDataSourceIF
-
getNumActive
public int getNumActive()
-
getNumIdle
public int getNumIdle()
-
getMaxTotal
public int getMaxTotal()
-
getMinIdle
public int getMinIdle()
-
getMaxIdle
public int getMaxIdle()
-
getConnectionsBorrowed
public long getConnectionsBorrowed()
-
getConnectionsReturned
public long getConnectionsReturned()
-
getConnectionsClosedByValidation
public long getConnectionsClosedByValidation()
-
getConnectionsClosedByEviction
public long getConnectionsClosedByEviction()
-
-