Class PoolUtils.CheckedKeyedObjectPool<K,V>

java.lang.Object
org.apache.commons.pool.PoolUtils.CheckedKeyedObjectPool<K,V>
All Implemented Interfaces:
KeyedObjectPool<K,V>
Enclosing class:
PoolUtils

private static class PoolUtils.CheckedKeyedObjectPool<K,V> extends Object implements KeyedObjectPool<K,V>
A keyed object pool that performs type checking on objects passed to pool methods.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final KeyedObjectPool<K,V>
    Underlying pool
    private final Class<V>
    Expected type of objects managed by the pool.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new CheckedKeyedObjectPool from the given pool with given expected object type.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addObject(K key)
    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, verifying correct return type.
    void
    Clears the pool, removing all pooled instances (optional operation).
    void
    clear(K key)
    Clears the specified pool, removing all pooled instances corresponding to the given key (optional operation).
    void
    Close this pool, and free any resources associated with it.
    int
    Returns the total number of instances current borrowed from this pool but not yet returned (optional operation).
    int
    Returns the number of instances currently borrowed from but not yet returned to the pool corresponding to the given key (optional operation).
    int
    Returns the total number of instances currently idle in this pool (optional operation).
    int
    Returns the number of instances corresponding to the given key currently idle in this pool (optional operation).
    void
    invalidateObject(K key, V obj)
    Invalidate an object to the pool, checking its type.
    void
    returnObject(K key, V obj)
    Return an object to the pool, checking its 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