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 JdbcPooledConnectionImplADatabaseConnectioninstance that provides connection pooling via c3p0.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_ACQUIRE_INCREMENTstatic intDEFAULT_MAXIMUM_POOL_SIZEstatic intDEFAULT_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 PooledDataSourcecreatePool()intcurrentBusyConnectionCount()intcurrentConnectionCount()intcurrentIdleConnectionCount()booleanequals(java.lang.Object o)Force implementations to over-ride equals with a semantic implementation.java.lang.IntegergetAcquireIncrement()TimeIntervalgetConnectionAcquireWait()TimeIntervalgetIdleConnectionTestPeriod()TimeIntervalgetMaxIdleTime()java.lang.IntegergetMaximumPoolSize()java.lang.IntegergetMinimumPoolSize()JdbcPoolFactorygetPoolFactory()inthashCode()Force implementations to over-ride hashcode.intmaxPoolSize()intminPoolSize()voidsetAcquireIncrement(java.lang.Integer acquireIncrement)voidsetConnectionAcquireWait(TimeInterval connectionAcquireWait)voidsetIdleConnectionTestPeriod(TimeInterval idleConnectionTestPeriod)voidsetMaxIdleTime(TimeInterval t)voidsetMaximumPoolSize(java.lang.Integer maximumPoolSize)voidsetMinimumPoolSize(java.lang.Integer minimumPoolSize)voidsetPoolFactory(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:
createPoolin classJdbcPooledConnectionImpl- Throws:
java.lang.Exception
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:DatabaseConnectionForce implementations to over-ride equals with a semantic implementation.
- Specified by:
equalsin classDatabaseConnection- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Description copied from class:DatabaseConnectionForce implementations to over-ride hashcode.
- Specified by:
hashCodein 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
-
-