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 String
ABANDON
static int
DEFAULT_ABANDON_TIMEOUT
static int
DEFAULT_IDLE_TIMEOUT
static int
DEFAULT_MAX_ACTIVE
static int
DEFAULT_MAX_IDLE
static int
DEFAULT_MIN_IDLE
static int
DEFAULT_USER_TIMEOUT
static String
DEFAULT_VALIDATION_QUERY
static int
DEFAULT_VALIDATION_TIMEOUT
static String
POOL
static String
RDBMS_CONNECTION_STRING
static String
RDBMS_DRIVER
static String
RDBMS_PASSWORD
static String
RDBMS_USERNAME
static String
VALIDATION_QUERY
static String
VALIDATION_QUERY_TIMEOUT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DBCPDataSource
fromConfiguration(Map<String,String> properties)
long
getConnectionsBorrowed()
long
getConnectionsClosed()
long
getConnectionsClosedByEviction()
long
getConnectionsClosedByValidation()
long
getConnectionsOpened()
long
getConnectionsReturned()
int
getMaxIdle()
int
getMaxTotal()
int
getMinIdle()
int
getNumActive()
int
getNumIdle()
-
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:
getConnectionsClosed
in interfaceInstrumentedDataSourceIF
-
getConnectionsOpened
public long getConnectionsOpened()
- Specified by:
getConnectionsOpened
in 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()
-
-