Class PoolUtils.ErodingObjectPool<T>

java.lang.Object
org.apache.commons.pool.PoolUtils.ErodingObjectPool<T>
All Implemented Interfaces:
ObjectPool<T>
Enclosing class:
PoolUtils

private static class PoolUtils.ErodingObjectPool<T> extends Object implements ObjectPool<T>
Decorates an object pool, adding "eroding" behavior. Based on the configured erosion factor, objects returning to the pool may be invalidated instead of being added to idle capacity.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Erosion factor
    private final ObjectPool<T>
    Underlying object pool
  • Constructor Summary

    Constructors
    Constructor
    Description
    ErodingObjectPool(ObjectPool<T> pool, float factor)
    Create an ErodingObjectPool wrapping the given pool using the specified erosion factor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Create an object using the factory or other implementation dependent mechanism, passivate it, and then place it in the idle object pool.
    Obtains an instance from this pool.
    void
    Clears any objects sitting idle in the pool, releasing any associated resources (optional operation).
    void
    Close this pool, and free any resources associated with it.
    int
    Return the number of instances currently borrowed from this pool (optional operation).
    int
    Return the number of instances currently idle in this pool (optional operation).
    void
    Invalidates an object from the pool.
    void
    Returns obj to the pool, unless erosion is triggered, in which case obj is invalidated.
    void
    Deprecated.
    to be removed in pool 2.0

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait