Class PoolUtils.ErodingObjectPool<T>

java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.pool2.PoolUtils.ErodingObjectPool<T>
Type Parameters:
T - type of objects in the pool
All Implemented Interfaces:
Closeable, AutoCloseable, 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)
    Creates an ErodingObjectPool wrapping the given pool using the specified erosion factor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Creates 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
    Closes this pool, and free any resources associated with it.
    int
    Returns the number of instances currently borrowed from this pool.
    int
    Returns the number of instances currently idle in this pool.
    void
    Invalidates an object from the pool.
    void
    Returns obj to the pool, unless erosion is triggered, in which case obj is invalidated.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.datanucleus.store.rdbms.datasource.dbcp2.pool2.ObjectPool

    addObjects