Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.pool.impl
Class StackObjectPoolFactory

    java.lang.Object
      org.apache.commons.pool.impl.StackObjectPoolFactory

All Implemented Interfaces:
  ObjectPoolFactory

    public class StackObjectPoolFactory

extends Object
implements ObjectPoolFactory

A factory for creating `StackObjectPool` instances.

Since:
  Pool 1.0
Version:
  $Revision: 960705 $ $Date: 2010-07-05 14:19:10 -0700 (Mon, 05 Jul 2010) $
Author:
  Rodney Waldhoff
See Also:
  `StackObjectPool`, `StackKeyedObjectPoolFactory`

Field Summary
`protected PoolableObjectFactory` | `_factory` Deprecated. to be made private in pool 2.0
`protected int` | `_initCapacity` Deprecated. to be made private in pool 2.0
`protected int` | `_maxSleeping` Deprecated. to be made private in pool 2.0

Constructor Summary
`StackObjectPoolFactory()` Deprecated. to be removed in pool 2.0 - use `StackObjectPoolFactory(PoolableObjectFactory)`
`StackObjectPoolFactory(int maxIdle)` Deprecated. to be removed in pool 2.0 - use `StackObjectPoolFactory(PoolableObjectFactory, int)`
`StackObjectPoolFactory(int maxIdle, int initIdleCapacity)` Deprecated. to be removed in pool 2.0 - use `StackObjectPoolFactory(PoolableObjectFactory, int, int)`
`StackObjectPoolFactory(PoolableObjectFactory factory)` Create a new StackObjectPoolFactory.
`StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle)` Create a new StackObjectPoolFactory.
`StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle, int initIdleCapacity)` Create a new StackObjectPoolFactory.

Method Summary
`ObjectPool` | `createPool()` Create a StackObjectPool.
`PoolableObjectFactory` | `getFactory()` Returns the factory used by created pools.
`int` | `getInitCapacity()` Returns the initial capacity of created pools.
`int` | `getMaxSleeping()` Returns the maxIdle setting for created pools.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _factory

    protected PoolableObjectFactory _factory

  Deprecated. to be made private in pool 2.0
  The PoolableObjectFactory used by created pools.

### _maxSleeping

    protected int _maxSleeping

  Deprecated. to be made private in pool 2.0
  The maximum number of idle instances in created pools.

### _initCapacity

    protected int _initCapacity

  Deprecated. to be made private in pool 2.0
  The initial size of created pools.

Constructor Detail

### StackObjectPoolFactory

    public StackObjectPoolFactory()

  Deprecated. to be removed in pool 2.0 - use `StackObjectPoolFactory(PoolableObjectFactory)`

  Create a new StackObjectPoolFactory.

  See Also:
    `StackObjectPool.StackObjectPool()`

### StackObjectPoolFactory

    public StackObjectPoolFactory(int maxIdle)

  Deprecated. to be removed in pool 2.0 - use `StackObjectPoolFactory(PoolableObjectFactory, int)`

  Create a new StackObjectPoolFactory.

  Parameters:
    `maxIdle` - cap on the number of "sleeping" instances in the pool.
  See Also:
    `StackObjectPool.StackObjectPool(int)`

### StackObjectPoolFactory

    public StackObjectPoolFactory(int maxIdle,
                                  int initIdleCapacity)

  Deprecated. to be removed in pool 2.0 - use `StackObjectPoolFactory(PoolableObjectFactory, int, int)`

  Create a new StackObjectPoolFactory.

  Parameters:
    `maxIdle` - cap on the number of "sleeping" instances in the pool.
    `initIdleCapacity` - - initial size of the pool (this specifies the size of the container, it does not cause the pool to be pre-populated.)
  See Also:
    `StackObjectPool.StackObjectPool(int, int)`

### StackObjectPoolFactory

    public StackObjectPoolFactory(PoolableObjectFactory factory)

  Create a new StackObjectPoolFactory.

  Parameters:
    `factory` - the PoolableObjectFactory used by created pools.
  See Also:
    `StackObjectPool.StackObjectPool(PoolableObjectFactory)`

### StackObjectPoolFactory

    public StackObjectPoolFactory(PoolableObjectFactory factory,
                                  int maxIdle)

  Create a new StackObjectPoolFactory.

  Parameters:
    `factory` - the PoolableObjectFactory used by created pools.
    `maxIdle` - cap on the number of "sleeping" instances in the pool.

### StackObjectPoolFactory

    public StackObjectPoolFactory(PoolableObjectFactory factory,
                                  int maxIdle,
                                  int initIdleCapacity)

  Create a new StackObjectPoolFactory.

  Parameters:
    `factory` - the PoolableObjectFactory used by created pools.
    `maxIdle` - cap on the number of "sleeping" instances in the pool.
    `initIdleCapacity` - - initial size of the pool (this specifies the size of the container, it does not cause the pool to be pre-populated.)

Method Detail

### createPool

    public ObjectPool createPool()

  Create a StackObjectPool.

  Specified by:
    `createPool` in interface `ObjectPoolFactory`
  Returns:
    a new StackObjectPool with the configured factory, maxIdle and initial capacity settings

### getFactory

    public PoolableObjectFactory getFactory()

  Returns the factory used by created pools.

  Returns:
    the PoolableObjectFactory used by created pools
  Since:
    1.5.5

### getMaxSleeping

    public int getMaxSleeping()

  Returns the maxIdle setting for created pools.

  Returns:
    the maximum number of idle instances in created pools
  Since:
    1.5.5

### getInitCapacity

    public int getInitCapacity()

  Returns the initial capacity of created pools.

  Returns:
    size of created containers (created pools are not pre-populated)
  Since:
    1.5.5

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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