Package com.adaptris.core.jdbc
Class PluggableJdbcPooledConnection
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.PluggableJdbcPooledConnection
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisConnection,ComponentLifecycle,ComponentLifecycleExtension,StateManagedComponent
@ComponentProfile(summary="Connect to a database using a JDBC driver; connection pooling is pluggable",
tag="connections,jdbc",
since="3.9.2")
public class PluggableJdbcPooledConnection
extends JdbcPooledConnectionImpl
Concrete
JdbcPooledConnectionImpl that allows you to plug in connection pool
implementations.
Generally, we find that c3p0 is good enough; however, in some use-cases you might want to switch to a different connection pool implementation. This variant allows you to plug in different builder implementations for the underlying connection pool.
-
Field Summary
Fields inherited from class com.adaptris.core.jdbc.JdbcPooledConnectionImpl
connectionPoolFields inherited from class com.adaptris.core.AdaptrisConnectionImp
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PooledDataSourcebooleanForce implementations to over-ride equals with a semantic implementation.inthashCode()Force implementations to over-ride hashcode.voidsetBuilder(ConnectionPoolBuilder builder) Set the builder to use when creating the connection pool.voidSet any additional connection pool properties over and above the defaults.withBuilder(ConnectionPoolBuilder builder) withPoolProperties(KeyValuePairSet values) Methods inherited from class com.adaptris.core.jdbc.JdbcPooledConnectionImpl
asDataSource, closeDatabaseConnection, getConnectionName, getConnectUrl, initialiseDatabaseConnection, makeConnection, setConnectUrl, startDatabaseConnection, stopDatabaseConnectionMethods inherited from class com.adaptris.core.jdbc.DatabaseConnection
alwaysValidateConnection, autoCommit, checkInternalState, closeConnection, connect, connectionProperties, debugMode, getAlwaysValidateConnection, getAutoCommit, getConnectionProperties, getDebugMode, getPassword, getUsername, initConnection, loadDriverClass, prepareConnection, setAlwaysValidateConnection, setAutoCommit, setConnectionProperties, setDebugMode, setPassword, setUsername, startConnection, stopConnectionMethods inherited from class com.adaptris.core.AllowsRetriesConnection
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryIntervalMethods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, connectionStateHandler, getConnectionErrorHandler, getConnectionStateHandler, getRuntimeComponent, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setConnectionStateHandler, setRuntimeComponent, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
Constructor Details
-
PluggableJdbcPooledConnection
public PluggableJdbcPooledConnection()
-
-
Method Details
-
createPool
- Specified by:
createPoolin classJdbcPooledConnectionImpl- Throws:
Exception
-
equals
Description copied from class:DatabaseConnectionForce implementations to over-ride equals with a semantic implementation.
- Specified by:
equalsin classDatabaseConnection- See Also:
-
hashCode
public int hashCode()Description copied from class:DatabaseConnectionForce implementations to over-ride hashcode.
- Specified by:
hashCodein classDatabaseConnection- See Also:
-
getBuilder
-
setBuilder
Set the builder to use when creating the connection pool.- Parameters:
builder- the builder, if not specified, then defaults toDefaultPoolFactory.
-
withBuilder
-
getPoolProperties
-
setPoolProperties
Set any additional connection pool properties over and above the defaults.By its very nature, since we don't know what connection pool implementation is going to be used, the specific keys and values required here will be dependent on the pool implementation. Please consult their documentation to figure out the correct values.
- Parameters:
kvps- the connection pool properties.
-
poolProperties
-
withPoolProperties
-