Package net.datenwerke.dbpool
Class MetaPoolService
java.lang.Object
net.datenwerke.dbpool.MetaPoolService
- All Implemented Interfaces:
DbPoolService
A pool service that can either use
DbC3p0PoolServiceImpl as backend.-
Constructor Summary
ConstructorsConstructorDescriptionMetaPoolService(DbPoolService c3p0, <any> useConnectionPool, JdbcService jdbcService) -
Method Summary
Modifier and TypeMethodDescriptiongetC3P0()getConnection(ConnectionPoolConfig config) 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.getDataSource(ConnectionPoolConfig config) getDataSource(ConnectionPoolConfig poolConfig, ConnectionConfig connConfig) 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.
-
Constructor Details
-
MetaPoolService
-
-
Method Details
-
getConnection
Description copied from interface:DbPoolServiceRetrieves aFuturethat contains a connection config for the pool specified by the suppliedConnectionPoolConfigobject.- Specified by:
getConnectionin interfaceDbPoolService- Parameters:
config- The config object specifying the connection pool- Returns:
- A connection wrapped in a
Future - Throws:
SQLException
-
getActiveService
-
getC3P0
-
isActive
public boolean isActive()Description copied from interface:DbPoolServiceReturns true if an active pool exists.- Specified by:
isActivein interfaceDbPoolService
-
getConnection
public Future 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- 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
-
shutdownPool
Description copied from interface:DbPoolServiceShuts down the pool identified by theConnectionPoolConfigobject.- Specified by:
shutdownPoolin interfaceDbPoolService- Parameters:
poolConfig- The pool identifier
-
shutdownAll
public void shutdownAll()Description copied from interface:DbPoolServiceAsks all available connection pools to be closed- Specified by:
shutdownAllin interfaceDbPoolService
-
getDataSource
- Specified by:
getDataSourcein interfaceDbPoolService
-
getDataSource
- Specified by:
getDataSourcein interfaceDbPoolService
-