org.ldaptive.pool
Interface ConnectionPool

All Known Implementing Classes:
AbstractConnectionPool, BlockingConnectionPool, SoftLimitConnectionPool

public interface ConnectionPool

Provides an interface for connection pooling.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Method Summary
 int activeCount()
          Returns the number of connections in use.
 int availableCount()
          Returns the number of connections available for use.
 void close()
          Empty this pool, freeing any resources.
 Activator<Connection> getActivator()
          Returns the activator for this pool.
 Connection getConnection()
          Returns an object from the pool.
 Passivator<Connection> getPassivator()
          Returns the passivator for this pool.
 Set<PooledConnectionStatistics> getPooledConnectionStatistics()
          Returns the statistics for each connection in the pool.
 Validator<Connection> getValidator()
          Returns the validator for this pool.
 void initialize()
          Initialize this pool for use.
 void setActivator(Activator<Connection> a)
          Sets the activator for this pool.
 void setPassivator(Passivator<Connection> p)
          Sets the passivator for this pool.
 void setValidator(Validator<Connection> v)
          Sets the validator for this pool.
 

Method Detail

getActivator

Activator<Connection> getActivator()
Returns the activator for this pool.

Returns:
activator

setActivator

void setActivator(Activator<Connection> a)
Sets the activator for this pool.

Parameters:
a - activator

getPassivator

Passivator<Connection> getPassivator()
Returns the passivator for this pool.

Returns:
passivator

setPassivator

void setPassivator(Passivator<Connection> p)
Sets the passivator for this pool.

Parameters:
p - passivator

getValidator

Validator<Connection> getValidator()
Returns the validator for this pool.

Returns:
validator

setValidator

void setValidator(Validator<Connection> v)
Sets the validator for this pool.

Parameters:
v - validator

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 fails
BlockingTimeoutException - if this pool is configured with a block time and it occurs
PoolInterruptedException - if this pool is configured with a block time and the current thread is interrupted

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

Set<PooledConnectionStatistics> getPooledConnectionStatistics()
Returns the statistics for each connection in the pool.

Returns:
connection statistics

close

void close()
Empty this pool, freeing any resources.



Copyright © 2003-2017 Virginia Tech. All Rights Reserved.