org.apache.commons.pool.impl
Class StackKeyedObjectPoolFactory

java.lang.Object
  extended by org.apache.commons.pool.impl.StackKeyedObjectPoolFactory
All Implemented Interfaces:
KeyedObjectPoolFactory

public class StackKeyedObjectPoolFactory
extends Object
implements KeyedObjectPoolFactory

A factory for creating StackKeyedObjectPool instances.

Since:
Pool 1.0
Version:
$Revision: 892236 $ $Date: 2013-12-31 04:43:12 +0000 (Tue, 31 Dec 2013) $
Author:
Rodney Waldhoff
See Also:
StackKeyedObjectPool, KeyedObjectPoolFactory

Field Summary
protected  KeyedPoolableObjectFactory _factory
          Deprecated. to be removed in pool 2.0
protected  int _initCapacity
          Deprecated. to be removed in pool 2.0
protected  int _maxSleeping
          Deprecated. to be removed in pool 2.0
 
Constructor Summary
StackKeyedObjectPoolFactory()
          Create a new StackKeyedObjectPoolFactory.
StackKeyedObjectPoolFactory(int maxSleeping)
          Create a new StackKeyedObjectPoolFactory.
StackKeyedObjectPoolFactory(int maxSleeping, int initialCapacity)
          Create a new StackKeyedObjectPoolFactory.
StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory)
          Create a new StackKeyedObjectPoolFactory.
StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int maxSleeping)
          Create a new StackKeyedObjectPoolFactory.
StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int maxSleeping, int initialCapacity)
          Create a new StackKeyedObjectPoolFactory.
 
Method Summary
 KeyedObjectPool createPool()
          Create a StackKeyedObjectPool with current property settings.
 KeyedPoolableObjectFactory getFactory()
          Returns the KeyedPoolableObjectFactory used by StackKeyedObjectPools created by this factory
 int 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_factory

protected KeyedPoolableObjectFactory _factory
Deprecated. to be removed in pool 2.0
KeyedPoolableObjectFactory used by StackKeyedObjectPools created by this factory


_maxSleeping

protected int _maxSleeping
Deprecated. to be removed in pool 2.0
Maximum number of idle instances in each keyed pool for StackKeyedObjectPools created by this factory


_initCapacity

protected int _initCapacity
Deprecated. to be removed in pool 2.0
Initial capacity of StackKeyedObjectPools created by this factory.

Constructor Detail

StackKeyedObjectPoolFactory

public StackKeyedObjectPoolFactory()
Create a new StackKeyedObjectPoolFactory.

See Also:
StackKeyedObjectPool.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.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.StackKeyedObjectPool(int, int)

StackKeyedObjectPoolFactory

public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory)
Create a new StackKeyedObjectPoolFactory.

Parameters:
factory - the KeyedPoolableObjectFactory used by created pools.
See Also:
StackKeyedObjectPool.StackKeyedObjectPool(KeyedPoolableObjectFactory)

StackKeyedObjectPoolFactory

public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory 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.StackKeyedObjectPool(KeyedPoolableObjectFactory, int)

StackKeyedObjectPoolFactory

public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory 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.StackKeyedObjectPool(KeyedPoolableObjectFactory, int, int)
Method Detail

createPool

public KeyedObjectPool createPool()
Create a StackKeyedObjectPool with current property settings.

Specified by:
createPool in interface KeyedObjectPoolFactory
Returns:
a new StackKeyedObjectPool with the configured factory, maxSleeping and initialCapacity

getFactory

public KeyedPoolableObjectFactory 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


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.