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. See LdapPoolConfig.setPruneTimerPeriod(long)
and LdapPoolConfig.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. See AbstractLdapPool
. Note that
this pool will begin blocking if it cannot create new ldap connections.AbstractLdapPool.PooledLdap<T extends BaseLdap>
active, available, checkInLock, checkOutLock, ldapFactory, logger, poolConfig, poolLock, poolNotEmpty
Constructor and Description |
---|
SoftLimitLdapPool()
Creates a new ldap pool using
DefaultLdapFactory . |
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.
|
Modifier and Type | Method and Description |
---|---|
Ldap |
checkOut()
Returns an ldap object from the pool.
|
blockAvailable, checkIn, getBlockWaitTime, retrieveAvailable, setBlockWaitTime
activateAndValidate, activeCount, availableCount, close, createActive, createAvailable, createAvailableAndActive, finalize, getLdapPoolConfig, initialize, prune, removeActive, removeAvailable, removeAvailableAndActive, setPoolTimer, validate, validateAndPassivate
public SoftLimitLdapPool()
DefaultLdapFactory
.public SoftLimitLdapPool(LdapFactory<Ldap> lf)
lf
- ldap factorypublic SoftLimitLdapPool(LdapPoolConfig lpc, LdapFactory<Ldap> lf)
lpc
- ldap pool configurationlf
- ldap factorypublic Ldap checkOut() throws LdapPoolException
checkOut
in interface LdapPool<Ldap>
checkOut
in class BlockingLdapPool
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 interruptedCopyright © 2016. All rights reserved.