Class ProxiedObjectPool<T>

java.lang.Object
org.apache.commons.pool2.proxy.ProxiedObjectPool<T>
Type Parameters:
T - type of the pooled object
All Implemented Interfaces:
Closeable, AutoCloseable, ObjectPool<T>

public class ProxiedObjectPool<T> extends Object implements ObjectPool<T>
Create a new object pool where the pooled objects are wrapped in proxies allowing better control of pooled objects and in particular the prevention of the continued use of an object by a client after that client returns the object to the pool.
Since:
2.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProxiedObjectPool(ObjectPool<T> pool, org.apache.commons.pool2.proxy.ProxySource<T> proxySource)
    Constructs a new proxied object pool.
  • 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.
    Borrows 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
    Gets the number of instances currently borrowed from this pool.
    int
    Gets the number of instances currently idle in this pool.
    void
    Invalidates an object from the pool.
    void
    returnObject(T proxy)
    Returns an instance to the pool.
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.commons.pool2.ObjectPool

    addObjects, invalidateObject