public class LdapConnectionPool extends org.apache.commons.pool.impl.GenericObjectPool<LdapConnection>
| Modifier and Type | Field and Description |
|---|---|
private org.apache.commons.pool.PoolableObjectFactory<LdapConnection> |
factory |
private static org.slf4j.Logger |
LOG |
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 and Description |
|---|
LdapConnectionPool(LdapConnectionConfig connectionConfig,
LdapApiService apiService,
long timeout)
Instantiates a new LDAP connection pool.
|
LdapConnectionPool(LdapConnectionConfig connectionConfig,
LdapApiService apiService,
long timeout,
org.apache.commons.pool.impl.GenericObjectPool.Config poolConfig)
Instantiates a new LDAP connection pool.
|
LdapConnectionPool(org.apache.commons.pool.PoolableObjectFactory<LdapConnection> factory)
Instantiates a new LDAP connection pool.
|
LdapConnectionPool(org.apache.commons.pool.PoolableObjectFactory<LdapConnection> factory,
org.apache.commons.pool.impl.GenericObjectPool.Config poolConfig)
Instantiates a new LDAP connection pool.
|
| Modifier and Type | Method and Description |
|---|---|
LdapConnection |
getConnection()
Gives a LdapConnection fetched from the pool.
|
LdapApiService |
getLdapApiService()
Returns the LdapApiService instance used by this connection pool.
|
private static ValidatingPoolableLdapConnectionFactory |
newPoolableConnectionFactory(LdapConnectionConfig connectionConfig,
LdapApiService apiService,
long timeout) |
void |
releaseConnection(LdapConnection connection)
Places the given LdapConnection back in the pool.
|
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, startEvictorprivate static final org.slf4j.Logger LOG
private org.apache.commons.pool.PoolableObjectFactory<LdapConnection> factory
public LdapConnectionPool(LdapConnectionConfig connectionConfig, LdapApiService apiService, long timeout)
connectionConfig - The connection configurationapiService - The api service (codec)timeout - The connection timeout in millispublic LdapConnectionPool(LdapConnectionConfig connectionConfig, LdapApiService apiService, long timeout, org.apache.commons.pool.impl.GenericObjectPool.Config poolConfig)
connectionConfig - The connection configurationapiService - The api service (codec)timeout - The connection timeout in millispoolConfig - The pool configurationpublic LdapConnectionPool(org.apache.commons.pool.PoolableObjectFactory<LdapConnection> factory)
factory - The LDAP connection factorypublic LdapConnectionPool(org.apache.commons.pool.PoolableObjectFactory<LdapConnection> factory, org.apache.commons.pool.impl.GenericObjectPool.Config poolConfig)
factory - The LDAP connection factorypoolConfig - The pool configurationpublic LdapApiService getLdapApiService()
public LdapConnection getConnection() throws LdapException
java.lang.Exception - if an error occurs while obtaining a connection from the factoryLdapExceptionprivate static ValidatingPoolableLdapConnectionFactory newPoolableConnectionFactory(LdapConnectionConfig connectionConfig, LdapApiService apiService, long timeout)
public void releaseConnection(LdapConnection connection) throws LdapException
connection - the LdapConnection to be releasedjava.lang.Exception - if an error occurs while releasing the connectionLdapException