Class ProxiedObjectPool<T>

java.lang.Object
org.apache.commons.pool2.proxy.ProxiedObjectPool<T>
Type Parameters:
T - type of the pooled object
All Implemented Interfaces:
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)
    Create a new proxied object 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.
    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.
    int
    Return the number of instances currently idle in this pool.
    void
    Invalidates an object from the pool.
    void
    returnObject(T proxy)
    Return an instance to the pool.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait