org.apache.directory.ldap.client.api
Class LdapConnectionPool

java.lang.Object
  extended by org.apache.commons.pool.BaseObjectPool<T>
      extended by org.apache.commons.pool.impl.GenericObjectPool<LdapConnection>
          extended by org.apache.directory.ldap.client.api.LdapConnectionPool
All Implemented Interfaces:
org.apache.commons.pool.ObjectPool<LdapConnection>

public class LdapConnectionPool
extends org.apache.commons.pool.impl.GenericObjectPool<LdapConnection>

A pool implementation for LdapConnection objects. This class is just a wrapper around the commons GenericObjectPool, and has a more meaningful name to represent the pool type.

Author:
Apache Directory Project

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.pool.impl.GenericObjectPool
org.apache.commons.pool.impl.GenericObjectPool.Config
 
Field Summary
 
Fields inherited from class org.apache.commons.pool.impl.GenericObjectPool
DEFAULT_LIFO, DEFAULT_MAX_ACTIVE, DEFAULT_MAX_IDLE, DEFAULT_MAX_WAIT, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_MIN_IDLE, DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TEST_WHILE_IDLE, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_WHEN_EXHAUSTED_ACTION, WHEN_EXHAUSTED_BLOCK, WHEN_EXHAUSTED_FAIL, WHEN_EXHAUSTED_GROW
 
Constructor Summary
LdapConnectionPool(PoolableLdapConnectionFactory factory)
          Instantiates a new LDAP connection pool.
 
Method Summary
 LdapConnection getConnection()
          Gives a LdapConnection fetched from the pool.
 void releaseConnection(LdapConnection connection)
          Places the given LdapConnection back in the pool.
 
Methods inherited from class org.apache.commons.pool.impl.GenericObjectPool
addObject, borrowObject, clear, close, evict, getLifo, getMaxActive, getMaxIdle, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getSoftMinEvictableIdleTimeMillis, getTestOnBorrow, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getWhenExhaustedAction, invalidateObject, returnObject, setConfig, setFactory, setLifo, setMaxActive, setMaxIdle, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setNumTestsPerEvictionRun, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setWhenExhaustedAction, startEvictor
 
Methods inherited from class org.apache.commons.pool.BaseObjectPool
assertOpen, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapConnectionPool

public LdapConnectionPool(PoolableLdapConnectionFactory factory)
Instantiates a new LDAP connection pool.

Parameters:
factory - the LDAP connection factory
Method Detail

getConnection

public LdapConnection getConnection()
                             throws Exception
Gives a LdapConnection fetched from the pool.

Returns:
an LdapConnection object from pool
Throws:
Exception - if an error occurs while obtaining a connection from the factory

releaseConnection

public void releaseConnection(LdapConnection connection)
                       throws Exception
Places the given LdapConnection back in the pool.

Parameters:
connection - the LdapConnection to be released
Throws:
Exception - if an error occurs while releasing the connection


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.