Package edu.vt.middleware.ldap.pool
Class SoftLimitLdapPool
- java.lang.Object
-
- edu.vt.middleware.ldap.pool.AbstractLdapPool<Ldap>
-
- edu.vt.middleware.ldap.pool.BlockingLdapPool
-
- edu.vt.middleware.ldap.pool.SoftLimitLdapPool
-
public class SoftLimitLdapPool extends BlockingLdapPool
SoftLimitLdapPool
implements a pool of ldap objects that has a set minimum and maximum size. The pool will grow beyond it's maximum size as necessary based on it's current load. Pool size will return to it's minimum based on the configuration of the prune timer. SeeLdapPoolConfig.setPruneTimerPeriod(long)
andLdapPoolConfig.setExpirationTime(long)
. This implementation should be used when you have some flexibility in the number of ldap connections that can be created to handle spikes in load. SeeAbstractLdapPool
. Note that this pool will begin blocking if it cannot create new ldap connections.- Version:
- $Revision: 2241 $ $Date: 2012-02-07 21:08:51 +0100 (Tue, 07 Feb 2012) $
- Author:
- Middleware Services
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.vt.middleware.ldap.pool.AbstractLdapPool
AbstractLdapPool.PooledLdap<T extends BaseLdap>
-
-
Field Summary
-
Fields inherited from class edu.vt.middleware.ldap.pool.AbstractLdapPool
active, available, checkInLock, checkOutLock, ldapFactory, logger, poolConfig, poolLock, poolNotEmpty
-
-
Constructor Summary
Constructors Constructor Description SoftLimitLdapPool()
Creates a new ldap pool usingDefaultLdapFactory
.SoftLimitLdapPool(LdapFactory<Ldap> lf)
Creates a new ldap pool with the supplied ldap factory.SoftLimitLdapPool(LdapPoolConfig lpc, LdapFactory<Ldap> lf)
Creates a new ldap pool with the supplied ldap config and factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Ldap
checkOut()
Returns an ldap object from the pool.-
Methods inherited from class edu.vt.middleware.ldap.pool.BlockingLdapPool
blockAvailable, checkIn, getBlockWaitTime, retrieveAvailable, setBlockWaitTime
-
Methods inherited from class edu.vt.middleware.ldap.pool.AbstractLdapPool
activateAndValidate, activeCount, availableCount, close, createActive, createAvailable, createAvailableAndActive, finalize, getLdapPoolConfig, initialize, prune, removeActive, removeAvailable, removeAvailableAndActive, setPoolTimer, validate, validateAndPassivate
-
-
-
-
Constructor Detail
-
SoftLimitLdapPool
public SoftLimitLdapPool()
Creates a new ldap pool usingDefaultLdapFactory
.
-
SoftLimitLdapPool
public SoftLimitLdapPool(LdapFactory<Ldap> lf)
Creates a new ldap pool with the supplied ldap factory.- Parameters:
lf
- ldap factory
-
SoftLimitLdapPool
public SoftLimitLdapPool(LdapPoolConfig lpc, LdapFactory<Ldap> lf)
Creates a new ldap pool with the supplied ldap config and factory.- Parameters:
lpc
- ldap pool configurationlf
- ldap factory
-
-
Method Detail
-
checkOut
public Ldap checkOut() throws LdapPoolException
Returns an ldap object from the pool.- Specified by:
checkOut
in interfaceLdapPool<Ldap>
- Overrides:
checkOut
in classBlockingLdapPool
- Returns:
- ldap object
- Throws:
LdapPoolException
- if this operation failsBlockingTimeoutException
- if this pool is configured with a block time and it occursPoolInterruptedException
- if this pool is configured with a block time and the current thread is interrupted
-
-