Class PoolUtils.CheckedObjectPool<T>

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

private static class PoolUtils.CheckedObjectPool<T> extends Object implements ObjectPool<T>
An object pool that performs type checking on objects passed to pool methods.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ObjectPool<T>
    Underlying object pool
    private final Class<T>
    Type of objects allowed in the pool.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a CheckedObjectPool accepting objects of the given type using the given pool.
  • 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.
    Borrow an object from the pool, checking its type.
    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, verifying that it is of the expected type.
    void
    Return an object to the pool, verifying that it is of the correct type.
    void
    Deprecated.
    to be removed in version 2.0

    Methods inherited from class java.lang.Object

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