| java.lang.Object org.apache.commons.pool.BaseKeyedObjectPool org.apache.commons.pool.impl.StackKeyedObjectPool
StackKeyedObjectPool | public class StackKeyedObjectPool extends BaseKeyedObjectPool implements KeyedObjectPool(Code) | | A simple,
java.util.Stack Stack -based
KeyedObjectPool implementation.
Given a
KeyedPoolableObjectFactory , this class will maintain
a simple pool of instances. A finite number of "sleeping"
or inactive instances is enforced, but when the pool is
empty, new instances are created to support the new load.
Hence this class places no limit on the number of "active"
instances created by the pool, but is quite useful for
re-using Objects without introducing
artificial limits.
author: Rodney Waldhoff version: $Revision: 328937 $ $Date: 2005-10-27 15:23:53 -0400 (Thu, 27 Oct 2005) $ |
DEFAULT_INIT_SLEEPING_CAPACITY | final protected static int DEFAULT_INIT_SLEEPING_CAPACITY(Code) | | The default initial size of the pool
(this specifies the size of the container, it does not
cause the pool to be pre-populated.)
|
DEFAULT_MAX_SLEEPING | final protected static int DEFAULT_MAX_SLEEPING(Code) | | The default cap on the number of "sleeping" instances in the pool.
|
_activeCount | protected HashMap _activeCount(Code) | | Number of active objects borrowed and not yet returned by pool
|
_initSleepingCapacity | protected int _initSleepingCapacity(Code) | | The initial capacity of each pool.
|
_maxSleeping | protected int _maxSleeping(Code) | | The cap on the number of "sleeping" instances in each pool.
|
_totActive | protected int _totActive(Code) | | Total number of object borrowed and not yet retuened for all pools
|
_totIdle | protected int _totIdle(Code) | | Total number of objects "sleeping" for all pools
|
StackKeyedObjectPool | public StackKeyedObjectPool(KeyedPoolableObjectFactory factory, int max)(Code) | | Create a new SimpleKeyedObjectPool using
the specified factory to create new instances.
capping the number of "sleeping" instances to max
Parameters: factory - the KeyedPoolableObjectFactory used to populate the pool Parameters: max - cap on the number of "sleeping" instances in the pool |
StackKeyedObjectPool | public StackKeyedObjectPool(KeyedPoolableObjectFactory factory, int max, int init)(Code) | | Create a new SimpleKeyedObjectPool using
the specified factory to create new instances.
capping the number of "sleeping" instances to max,
and initially allocating a container capable of containing
at least init instances.
Parameters: factory - the KeyedPoolableObjectFactory used to populate the pool Parameters: max - cap on the number of "sleeping" instances in the pool Parameters: init - initial size of the pool (this specifies the size of the container,it does not cause the pool to be pre-populated.) |
clear | public synchronized void clear()(Code) | | |
getNumActive | public int getNumActive()(Code) | | |
getNumActive | public synchronized int getNumActive(Object key)(Code) | | |
getNumIdle | public int getNumIdle()(Code) | | |
getNumIdle | public synchronized int getNumIdle(Object key)(Code) | | |
|
|