Package org.apache.commons.pool2.proxy
Class CglibProxySource<T>
- java.lang.Object
-
- org.apache.commons.pool2.proxy.CglibProxySource<T>
-
- Type Parameters:
T- type of the pooled object to be proxied
- All Implemented Interfaces:
ProxySource<T>
public class CglibProxySource<T> extends java.lang.Object implements ProxySource<T>
cglib is unmaintained and does not work well (or possibly at all?) in newer JDKs, particularly JDK17+; see https://github.com/cglib/cglibProvides proxy objects using CGLib.
- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<? extends T>superclass
-
Constructor Summary
Constructors Constructor Description CglibProxySource(java.lang.Class<? extends T> superclass)Constructs a new proxy source for the given class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TcreateProxy(T pooledObject, UsageTracking<T> usageTracking)Creates a new proxy object, wrapping the given pooled object.TresolveProxy(T proxy)Resolves the wrapped object from the given proxy.java.lang.StringtoString()
-
-
-
Field Detail
-
superclass
private final java.lang.Class<? extends T> superclass
-
-
Constructor Detail
-
CglibProxySource
public CglibProxySource(java.lang.Class<? extends T> superclass)
Constructs a new proxy source for the given class.- Parameters:
superclass- The class to proxy
-
-
Method Detail
-
createProxy
public T createProxy(T pooledObject, UsageTracking<T> usageTracking)
Description copied from interface:ProxySourceCreates a new proxy object, wrapping the given pooled object.- Specified by:
createProxyin interfaceProxySource<T>- Parameters:
pooledObject- The object to wrapusageTracking- The instance, if any (usually the object pool) to be provided with usage tracking information for this wrapped object- Returns:
- the new proxy object
-
resolveProxy
public T resolveProxy(T proxy)
Description copied from interface:ProxySourceResolves the wrapped object from the given proxy.- Specified by:
resolveProxyin interfaceProxySource<T>- Parameters:
proxy- The proxy object- Returns:
- The pooled object wrapped by the given proxy
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Since:
- 2.4.3
-
-