Top Description Fields Constructors Methods
org.apache.commons.pool2.proxy

public Class CglibProxySource<T>

extends Object
implements ProxySource<T>
Class Inheritance
All Implemented Interfaces
org.apache.commons.pool2.proxy.ProxySource
Type Parameters
<T>
type of the pooled object to be proxied
Imports
org.apache.commons.pool2.UsageTracking, net.sf.cglib.proxy.Enhancer, .Factory

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

Provides proxy objects using CGLib.

Since
2.0

Field Summary

Modifier and TypeField and Description
private final Class<? extends T>

Constructor Summary

AccessConstructor and Description
public
CglibProxySource(final Class<? extends T>
The class to proxy
superclass
)

Constructs a new proxy source for the given class.

Method Summary

Modifier and TypeMethod and Description
public T
createProxy(final T pooledObject, final UsageTracking<T> usageTracking)

Implements org.apache.commons.pool2.proxy.ProxySource.createProxy.

Creates a new proxy object, wrapping the given pooled object.

public T
resolveProxy(final T proxy)

Implements org.apache.commons.pool2.proxy.ProxySource.resolveProxy.

Resolves the wrapped object from the given proxy.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

superclassback to summary
private final Class<? extends T> superclass

Constructor Detail

CglibProxySourceback to summary
public CglibProxySource(final Class<? extends T> superclass)

Constructs a new proxy source for the given class.

Parameters
superclass:Class<? extends T>

The class to proxy

Method Detail

createProxyback to summary
public T createProxy(final T pooledObject, final UsageTracking<T> usageTracking)

Implements org.apache.commons.pool2.proxy.ProxySource.createProxy.

Doc from org.apache.commons.pool2.proxy.ProxySource.createProxy.

Creates a new proxy object, wrapping the given pooled object.

Annotations
@SuppressWarnings:unchecked
@Override
resolveProxyback to summary
public T resolveProxy(final T proxy)

Implements org.apache.commons.pool2.proxy.ProxySource.resolveProxy.

Doc from org.apache.commons.pool2.proxy.ProxySource.resolveProxy.

Resolves the wrapped object from the given proxy.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
Since
2.4.3