Package com.adaptris.core.jdbc
Class JdbcPooledConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.core.AllowsRetriesConnection
-
- com.adaptris.core.jdbc.DatabaseConnection
-
- com.adaptris.core.jdbc.JdbcPooledConnectionImpl
-
- com.adaptris.core.jdbc.JdbcPooledConnection
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisConnection
,ComponentLifecycle
,ComponentLifecycleExtension
,StateManagedComponent
@ComponentProfile(summary="Connect to a database using a JDBC driver; connection pooling handled via C3P0", tag="connections,jdbc") public class JdbcPooledConnection extends JdbcPooledConnectionImpl
ADatabaseConnection
instance that provides connection pooling via c3p0.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_ACQUIRE_INCREMENT
static int
DEFAULT_MAXIMUM_POOL_SIZE
static int
DEFAULT_MINIMUM_POOL_SIZE
-
Fields inherited from class com.adaptris.core.jdbc.JdbcPooledConnectionImpl
connectionPool
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description JdbcPooledConnection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PooledDataSource
createPool()
int
currentBusyConnectionCount()
int
currentConnectionCount()
int
currentIdleConnectionCount()
boolean
equals(java.lang.Object o)
Force implementations to over-ride equals with a semantic implementation.java.lang.Integer
getAcquireIncrement()
TimeInterval
getConnectionAcquireWait()
TimeInterval
getIdleConnectionTestPeriod()
TimeInterval
getMaxIdleTime()
java.lang.Integer
getMaximumPoolSize()
java.lang.Integer
getMinimumPoolSize()
JdbcPoolFactory
getPoolFactory()
int
hashCode()
Force implementations to over-ride hashcode.int
maxPoolSize()
int
minPoolSize()
void
setAcquireIncrement(java.lang.Integer acquireIncrement)
void
setConnectionAcquireWait(TimeInterval connectionAcquireWait)
void
setIdleConnectionTestPeriod(TimeInterval idleConnectionTestPeriod)
void
setMaxIdleTime(TimeInterval t)
void
setMaximumPoolSize(java.lang.Integer maximumPoolSize)
void
setMinimumPoolSize(java.lang.Integer minimumPoolSize)
void
setPoolFactory(JdbcPoolFactory f)
-
Methods inherited from class com.adaptris.core.jdbc.JdbcPooledConnectionImpl
asDataSource, closeDatabaseConnection, getConnectionName, getConnectUrl, initialiseDatabaseConnection, makeConnection, setConnectUrl, startDatabaseConnection, stopDatabaseConnection
-
Methods inherited from class com.adaptris.core.jdbc.DatabaseConnection
alwaysValidateConnection, autoCommit, checkInternalState, closeConnection, connect, connectionProperties, debugMode, getAlwaysValidateConnection, getAutoCommit, getConnectionProperties, getDebugMode, getDriverImp, getPassword, getUsername, initConnection, loadDriverClass, prepareConnection, setAlwaysValidateConnection, setAutoCommit, setConnectionProperties, setDebugMode, setDriverImp, setPassword, setUsername, startConnection, stopConnection
-
Methods inherited from class com.adaptris.core.AllowsRetriesConnection
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryInterval
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Field Detail
-
DEFAULT_MINIMUM_POOL_SIZE
public static final int DEFAULT_MINIMUM_POOL_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_POOL_SIZE
public static final int DEFAULT_MAXIMUM_POOL_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_ACQUIRE_INCREMENT
public static final int DEFAULT_ACQUIRE_INCREMENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
createPool
protected PooledDataSource createPool() throws java.lang.Exception
- Specified by:
createPool
in classJdbcPooledConnectionImpl
- Throws:
java.lang.Exception
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:DatabaseConnection
Force implementations to over-ride equals with a semantic implementation.
- Specified by:
equals
in classDatabaseConnection
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Description copied from class:DatabaseConnection
Force implementations to over-ride hashcode.
- Specified by:
hashCode
in classDatabaseConnection
- See Also:
Object.hashCode()
-
getMinimumPoolSize
public java.lang.Integer getMinimumPoolSize()
-
setMinimumPoolSize
public void setMinimumPoolSize(java.lang.Integer minimumPoolSize)
-
minPoolSize
public int minPoolSize()
-
getMaximumPoolSize
public java.lang.Integer getMaximumPoolSize()
-
setMaximumPoolSize
public void setMaximumPoolSize(java.lang.Integer maximumPoolSize)
-
maxPoolSize
public int maxPoolSize()
-
getAcquireIncrement
public java.lang.Integer getAcquireIncrement()
-
setAcquireIncrement
public void setAcquireIncrement(java.lang.Integer acquireIncrement)
-
getConnectionAcquireWait
public TimeInterval getConnectionAcquireWait()
-
setConnectionAcquireWait
public void setConnectionAcquireWait(TimeInterval connectionAcquireWait)
-
getIdleConnectionTestPeriod
public TimeInterval getIdleConnectionTestPeriod()
-
setIdleConnectionTestPeriod
public void setIdleConnectionTestPeriod(TimeInterval idleConnectionTestPeriod)
-
getMaxIdleTime
public TimeInterval getMaxIdleTime()
-
setMaxIdleTime
public void setMaxIdleTime(TimeInterval t)
-
currentBusyConnectionCount
public int currentBusyConnectionCount() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
currentConnectionCount
public int currentConnectionCount() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
currentIdleConnectionCount
public int currentIdleConnectionCount() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getPoolFactory
public JdbcPoolFactory getPoolFactory()
- Returns:
- the poolFactory
-
setPoolFactory
public void setPoolFactory(JdbcPoolFactory f)
- Parameters:
f
- the poolFactory to set
-
-