public class DbC3p0PoolServiceImpl extends DbPoolServiceImpl<ComboPooledDataSource> implements DbPoolService<ComboPooledDataSource>
DbPoolService
using C3P0 as connection pool.Constructor and Description |
---|
DbC3p0PoolServiceImpl(EntityDiffService entityDiffService,
ConfigService configService,
JdbcService jdbcService) |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<java.sql.Connection> |
getConnection(ConnectionPoolConfig poolConfig)
Retrieves a
Future that contains a connection config for the pool
specified by the supplied ConnectionPoolConfig object. |
java.util.concurrent.Future<java.sql.Connection> |
getConnection(ConnectionPoolConfig poolConfig,
ConnectionConfig connConfig)
Retrieves a
Future that contains a connection object for the pool
specified by the supplied ConnectionPoolConfig object. |
java.util.Map<ConnectionPoolConfig,ComboPooledDataSource> |
getPoolMap()
Returns a map of all active pools.
|
boolean |
isActive()
Returns true if an active pool exists.
|
void |
shutdownAll()
Asks all available connection pools to be closed
|
void |
shutdownPool(ConnectionPoolConfig poolConfig)
Shuts down the pool identified by the
ConnectionPoolConfig object. |
getDataSource, getDataSource
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataSource, getDataSource
public DbC3p0PoolServiceImpl(EntityDiffService entityDiffService, ConfigService configService, JdbcService jdbcService)
public java.util.concurrent.Future<java.sql.Connection> getConnection(ConnectionPoolConfig poolConfig) throws java.sql.SQLException
DbPoolService
Future
that contains a connection config for the pool
specified by the supplied ConnectionPoolConfig
object.getConnection
in interface DbPoolService<ComboPooledDataSource>
poolConfig
- The config object specifying the connection poolFuture
java.sql.SQLException
public java.util.concurrent.Future<java.sql.Connection> getConnection(ConnectionPoolConfig poolConfig, ConnectionConfig connConfig) throws java.sql.SQLException
DbPoolService
Future
that contains a connection object for the pool
specified by the supplied ConnectionPoolConfig
object. The connection
is configured as specified by the ConnectionConfig
.getConnection
in interface DbPoolService<ComboPooledDataSource>
poolConfig
- The config object specifying the poolconnConfig
- A config object specifying connection propertiesFuture
java.sql.SQLException
public java.util.Map<ConnectionPoolConfig,ComboPooledDataSource> getPoolMap()
DbPoolService
getPoolMap
in interface DbPoolService<ComboPooledDataSource>
public void shutdownAll()
DbPoolService
shutdownAll
in interface DbPoolService<ComboPooledDataSource>
public void shutdownPool(ConnectionPoolConfig poolConfig)
DbPoolService
ConnectionPoolConfig
object.shutdownPool
in interface DbPoolService<ComboPooledDataSource>
poolConfig
- The pool identifierpublic boolean isActive()
DbPoolService
isActive
in interface DbPoolService<ComboPooledDataSource>