Package org.ldaptive.pool
Interface ConnectionPool
-
- All Known Implementing Classes:
AbstractConnectionPool,BlockingConnectionPool,PooledConnectionFactory
public interface ConnectionPoolProvides an interface for connection pooling.- Author:
- Middleware Services
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intactiveCount()Returns the number of connections in use.intavailableCount()Returns the number of connections available for use.voidclose()Empty this pool, freeing any resources.ConnectionActivatorgetActivator()Returns the activator for this pool.ConnectiongetConnection()Returns an object from the pool.ConnectionPassivatorgetPassivator()Returns the passivator for this pool.java.util.Set<PooledConnectionStatistics>getPooledConnectionStatistics()Returns the statistics for each connection in the pool.voidinitialize()Initialize this pool for use.voidsetActivator(ConnectionActivator a)Sets the activator for this pool.voidsetPassivator(ConnectionPassivator p)Sets the passivator for this pool.
-
-
-
Method Detail
-
getActivator
ConnectionActivator getActivator()
Returns the activator for this pool.- Returns:
- activator
-
setActivator
void setActivator(ConnectionActivator a)
Sets the activator for this pool.- Parameters:
a- activator
-
getPassivator
ConnectionPassivator getPassivator()
Returns the passivator for this pool.- Returns:
- passivator
-
setPassivator
void setPassivator(ConnectionPassivator p)
Sets the passivator for this pool.- Parameters:
p- passivator
-
initialize
void initialize()
Initialize this pool for use.
-
getConnection
Connection getConnection() throws PoolException
Returns an object from the pool.- Returns:
- pooled object
- Throws:
PoolException- if this operation failsBlockingTimeoutException- if this pool is configured with a block time and it occurs
-
availableCount
int availableCount()
Returns the number of connections available for use.- Returns:
- count
-
activeCount
int activeCount()
Returns the number of connections in use.- Returns:
- count
-
getPooledConnectionStatistics
java.util.Set<PooledConnectionStatistics> getPooledConnectionStatistics()
Returns the statistics for each connection in the pool.- Returns:
- connection statistics
-
close
void close()
Empty this pool, freeing any resources.
-
-