Package org.apache.commons.pool.impl
Class StackKeyedObjectPoolFactory<K,V>
- java.lang.Object
-
- org.apache.commons.pool.impl.StackKeyedObjectPoolFactory<K,V>
-
- Type Parameters:
K
- the type of keys in this poolV
- the type of objects held in this pool
- All Implemented Interfaces:
KeyedObjectPoolFactory<K,V>
public class StackKeyedObjectPoolFactory<K,V> extends Object implements KeyedObjectPoolFactory<K,V>
A factory for creatingStackKeyedObjectPool
instances.- Since:
- Pool 1.0
- Version:
- $Revision: 1222396 $ $Date: 2011-12-22 14:02:25 -0500 (Thu, 22 Dec 2011) $
- Author:
- Rodney Waldhoff
- See Also:
StackKeyedObjectPool
,KeyedObjectPoolFactory
-
-
Constructor Summary
Constructors Constructor Description StackKeyedObjectPoolFactory()
Create a new StackKeyedObjectPoolFactory.StackKeyedObjectPoolFactory(int maxSleeping)
Create a new StackKeyedObjectPoolFactory.StackKeyedObjectPoolFactory(int maxSleeping, int initialCapacity)
Create a new StackKeyedObjectPoolFactory.StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory)
Create a new StackKeyedObjectPoolFactory.StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxSleeping)
Create a new StackKeyedObjectPoolFactory.StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxSleeping, int initialCapacity)
Create a new StackKeyedObjectPoolFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyedObjectPool<K,V>
createPool()
Create a StackKeyedObjectPool with current property settings.KeyedPoolableObjectFactory<K,V>
getFactory()
Returns the KeyedPoolableObjectFactory used by StackKeyedObjectPools created by this factoryint
getInitialCapacity()
Returns the initial capacity of StackKeyedObjectPools created by this factory.int
getMaxSleeping()
Returns the maximum number of idle instances in each keyed pool for StackKeyedObjectPools created by this factory
-
-
-
Constructor Detail
-
StackKeyedObjectPoolFactory
public StackKeyedObjectPoolFactory()
Create a new StackKeyedObjectPoolFactory.- See Also:
StackKeyedObjectPool()
-
StackKeyedObjectPoolFactory
public StackKeyedObjectPoolFactory(int maxSleeping)
Create a new StackKeyedObjectPoolFactory.- Parameters:
maxSleeping
- cap on the number of "sleeping" instances in the pool.- See Also:
StackKeyedObjectPool(int)
-
StackKeyedObjectPoolFactory
public StackKeyedObjectPoolFactory(int maxSleeping, int initialCapacity)
Create a new StackKeyedObjectPoolFactory.- Parameters:
maxSleeping
- cap on the number of "sleeping" instances in the pool.initialCapacity
- initial size of the pool (this specifies the size of the container, it does not cause the pool to be pre-populated.)- See Also:
StackKeyedObjectPool(int, int)
-
StackKeyedObjectPoolFactory
public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory)
Create a new StackKeyedObjectPoolFactory.- Parameters:
factory
- the KeyedPoolableObjectFactory used by created pools.- See Also:
StackKeyedObjectPool(KeyedPoolableObjectFactory)
-
StackKeyedObjectPoolFactory
public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxSleeping)
Create a new StackKeyedObjectPoolFactory.- Parameters:
factory
- the KeyedPoolableObjectFactory used by created pools.maxSleeping
- cap on the number of "sleeping" instances in the pool.- See Also:
StackKeyedObjectPool(KeyedPoolableObjectFactory, int)
-
StackKeyedObjectPoolFactory
public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxSleeping, int initialCapacity)
Create a new StackKeyedObjectPoolFactory.- Parameters:
factory
- the KeyedPoolableObjectFactory used by created pools.maxSleeping
- cap on the number of "sleeping" instances in the pool.initialCapacity
- initial size of the pool (this specifies the size of the container, it does not cause the pool to be pre-populated.)- See Also:
StackKeyedObjectPool(KeyedPoolableObjectFactory, int, int)
-
-
Method Detail
-
createPool
public KeyedObjectPool<K,V> createPool()
Create a StackKeyedObjectPool with current property settings.- Specified by:
createPool
in interfaceKeyedObjectPoolFactory<K,V>
- Returns:
- a new StackKeyedObjectPool with the configured factory, maxSleeping and initialCapacity
-
getFactory
public KeyedPoolableObjectFactory<K,V> getFactory()
Returns the KeyedPoolableObjectFactory used by StackKeyedObjectPools created by this factory- Returns:
- factory setting for created pools
- Since:
- 1.5.5
-
getMaxSleeping
public int getMaxSleeping()
Returns the maximum number of idle instances in each keyed pool for StackKeyedObjectPools created by this factory- Returns:
- maxSleeping setting for created pools
- Since:
- 1.5.5
-
getInitialCapacity
public int getInitialCapacity()
Returns the initial capacity of StackKeyedObjectPools created by this factory.- Returns:
- initial capacity setting for created pools
- Since:
- 1.5.5
-
-