edu.vt.middleware.ldap.pool
Class SoftLimitLdapPool

java.lang.Object
  extended by edu.vt.middleware.ldap.pool.AbstractLdapPool<Ldap>
      extended by edu.vt.middleware.ldap.pool.BlockingLdapPool
          extended by edu.vt.middleware.ldap.pool.SoftLimitLdapPool
All Implemented Interfaces:
LdapPool<Ldap>

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.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
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
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.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoftLimitLdapPool

public SoftLimitLdapPool()
Creates a new ldap pool using DefaultLdapFactory.


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 configuration
lf - ldap factory
Method Detail

checkOut

public Ldap checkOut()
              throws LdapPoolException
Returns an ldap object from the pool.

Specified by:
checkOut in interface LdapPool<Ldap>
Overrides:
checkOut in class BlockingLdapPool
Returns:
ldap object
Throws:
LdapPoolException - 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


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