# Package org.apache.commons.pool2.proxy

package org.apache.commons.pool2.proxy
Object pooling proxy implementations.

The `org.apache.commons.pool2.proxy` package defines a object pool that wraps all objects returned to clients. This allows it to disable those proxies when the objects are returned thereby enabling the continued use of those objects by clients to be detected.

Support is provided for `java.lang.reflect.Proxy` and for `net.sf.cglib.proxy` based proxies. The latter, requires the additional of the optional Code Generation Library (GCLib).

cglib is unmaintained and does not work well (or possibly at all?) in newer JDKs, particularly JDK17+; see https://github.com/cglib/cglib

- Related Packages
  Package
  Description
  org.apache.commons.pool2
  Object pooling API.
  org.apache.commons.pool2.impl
  Object pooling API implementations.
- Classes
  Class
  Description
  CglibProxySource<T>
  cglib is unmaintained and does not work well (or possibly at all?)
  JdkProxySource<T>
  Provides proxy objects using Java reflection.
  ProxiedKeyedObjectPool<K,V>
  Create a new keyed 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.
  ProxiedObjectPool<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.