org.ldaptive.pool
Class SoftLimitConnectionPool

java.lang.Object
  extended by org.ldaptive.pool.AbstractPool<Connection>
      extended by org.ldaptive.pool.AbstractConnectionPool
          extended by org.ldaptive.pool.BlockingConnectionPool
              extended by org.ldaptive.pool.SoftLimitConnectionPool
All Implemented Interfaces:
ConnectionPool

public class SoftLimitConnectionPool
extends BlockingConnectionPool

Implements a pool of connections 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 strategy. See PruneStrategy. This implementation should be used when you have some flexibility in the number of connections that can be created to handle spikes in load. See AbstractConnectionPool. Note that this pool will begin blocking if it cannot create new connections.

Version:
$Revision: 2967 $ $Date: 2014-04-09 16:37:01 -0400 (Wed, 09 Apr 2014) $
Author:
Middleware Services

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ldaptive.pool.AbstractConnectionPool
AbstractConnectionPool.DefaultPooledConnectionProxy
 
Field Summary
 
Fields inherited from class org.ldaptive.pool.AbstractConnectionPool
active, available, checkInLock, checkOutLock, poolLock, poolNotEmpty
 
Fields inherited from class org.ldaptive.pool.AbstractPool
logger
 
Constructor Summary
SoftLimitConnectionPool()
          Creates a new soft limit pool.
SoftLimitConnectionPool(DefaultConnectionFactory cf)
          Creates a new soft limit pool.
SoftLimitConnectionPool(PoolConfig pc, DefaultConnectionFactory cf)
          Creates a new soft limit pool.
 
Method Summary
 Connection getConnection()
          Returns a connection from the pool.
 
Methods inherited from class org.ldaptive.pool.BlockingConnectionPool
blockAvailableConnection, getBlockWaitTime, putConnection, retrieveAvailableConnection, setBlockWaitTime
 
Methods inherited from class org.ldaptive.pool.AbstractConnectionPool
activateAndValidateConnection, activeCount, availableCount, close, createActiveConnection, createActiveConnection, createAvailableConnection, createAvailableConnection, createConnection, createConnection, createConnectionProxy, finalize, getConnectionFactory, getConnectOnCreate, getFailFastInitialize, getPooledConnectionStatistics, getQueueType, grow, grow, initialize, isInitialized, prune, removeActiveConnection, removeAvailableAndActiveConnection, removeAvailableConnection, retrieveConnectionProxy, setConnectionFactory, setConnectOnCreate, setFailFastInitialize, setQueueType, toString, validate, validateAndPassivateConnection
 
Methods inherited from class org.ldaptive.pool.AbstractPool
activate, getActivator, getName, getPassivator, getPoolConfig, getPruneStrategy, getValidator, passivate, setActivator, setName, setPassivator, setPoolConfig, setPruneStrategy, setValidator, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ldaptive.pool.ConnectionPool
getActivator, getPassivator, getValidator, setActivator, setPassivator, setValidator
 

Constructor Detail

SoftLimitConnectionPool

public SoftLimitConnectionPool()
Creates a new soft limit pool.


SoftLimitConnectionPool

public SoftLimitConnectionPool(DefaultConnectionFactory cf)
Creates a new soft limit pool.

Parameters:
cf - connection factory

SoftLimitConnectionPool

public SoftLimitConnectionPool(PoolConfig pc,
                               DefaultConnectionFactory cf)
Creates a new soft limit pool.

Parameters:
pc - pool configuration
cf - connection factory
Method Detail

getConnection

public Connection getConnection()
                         throws PoolException
Returns a connection from the pool.

Specified by:
getConnection in interface ConnectionPool
Overrides:
getConnection in class BlockingConnectionPool
Returns:
connection
Throws:
PoolException - 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-2015 Virginia Tech. All Rights Reserved.