Package net.datenwerke.dbpool
Class DbC3p0PoolServiceImpl
java.lang.Object
net.datenwerke.dbpool.DbPoolServiceImpl<ComboPooledDataSource>
net.datenwerke.dbpool.DbC3p0PoolServiceImpl
- All Implemented Interfaces:
DbPoolService<ComboPooledDataSource>
public class DbC3p0PoolServiceImpl
extends DbPoolServiceImpl<ComboPooledDataSource>
implements DbPoolService<ComboPooledDataSource>
Implementation of
DbPoolService using C3P0 as connection pool.-
Constructor Summary
ConstructorsConstructorDescriptionDbC3p0PoolServiceImpl(EntityDiffService entityDiffService, ConfigService configService, JdbcService jdbcService) -
Method Summary
Modifier and TypeMethodDescriptiongetConnection(ConnectionPoolConfig poolConfig) Retrieves aFuturethat contains a connection config for the pool specified by the suppliedConnectionPoolConfigobject.getConnection(ConnectionPoolConfig poolConfig, ConnectionConfig connConfig) Retrieves aFuturethat contains a connection object for the pool specified by the suppliedConnectionPoolConfigobject.Map<ConnectionPoolConfig, ComboPooledDataSource> Returns a map of all active pools.booleanisActive()Returns true if an active pool exists.voidAsks all available connection pools to be closedvoidshutdownPool(ConnectionPoolConfig poolConfig) Shuts down the pool identified by theConnectionPoolConfigobject.Methods inherited from class net.datenwerke.dbpool.DbPoolServiceImpl
getDataSource, getDataSourceMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.datenwerke.dbpool.DbPoolService
getDataSource, getDataSource
-
Constructor Details
-
DbC3p0PoolServiceImpl
public DbC3p0PoolServiceImpl(EntityDiffService entityDiffService, ConfigService configService, JdbcService jdbcService)
-
-
Method Details
-
getConnection
Description copied from interface:DbPoolServiceRetrieves aFuturethat contains a connection config for the pool specified by the suppliedConnectionPoolConfigobject.- Specified by:
getConnectionin interfaceDbPoolService<ComboPooledDataSource>- Parameters:
poolConfig- The config object specifying the connection pool- Returns:
- A connection wrapped in a
Future - Throws:
SQLException
-
getConnection
public Future<Connection> getConnection(ConnectionPoolConfig poolConfig, ConnectionConfig connConfig) throws SQLException Description copied from interface:DbPoolServiceRetrieves aFuturethat contains a connection object for the pool specified by the suppliedConnectionPoolConfigobject. The connection is configured as specified by theConnectionConfig.- Specified by:
getConnectionin interfaceDbPoolService<ComboPooledDataSource>- Parameters:
poolConfig- The config object specifying the poolconnConfig- A config object specifying connection properties- Returns:
- A connection wrapped in a
Future - Throws:
SQLException
-
getPoolMap
Description copied from interface:DbPoolServiceReturns a map of all active pools.- Specified by:
getPoolMapin interfaceDbPoolService<ComboPooledDataSource>
-
shutdownAll
public void shutdownAll()Description copied from interface:DbPoolServiceAsks all available connection pools to be closed- Specified by:
shutdownAllin interfaceDbPoolService<ComboPooledDataSource>
-
shutdownPool
Description copied from interface:DbPoolServiceShuts down the pool identified by theConnectionPoolConfigobject.- Specified by:
shutdownPoolin interfaceDbPoolService<ComboPooledDataSource>- Parameters:
poolConfig- The pool identifier
-
isActive
public boolean isActive()Description copied from interface:DbPoolServiceReturns true if an active pool exists.- Specified by:
isActivein interfaceDbPoolService<ComboPooledDataSource>
-