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

pack-priv final Class CglibProxyHandler<T>

extends BaseProxyHandler<T>
implements MethodInterceptor
Class Inheritance
All Implemented Interfaces
net.sf.cglib.proxy.MethodInterceptor, net.sf.cglib.proxy.Callback
Type Parameters
<T>
type of the wrapped pooled object
Imports
java.lang.reflect.Method, org.apache.commons.pool2.UsageTracking, net.sf.cglib.proxy.MethodInterceptor, .MethodProxy

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

CGLib implementation of the proxy handler.

Since
2.0

Constructor Summary

AccessConstructor and Description
pack-priv
CglibProxyHandler(final T
The object to wrap
pooledObject
,
final UsageTracking<T>
The instance, if any (usually the object pool) to be provided with usage tracking information for this wrapped object
usageTracking
)

Constructs a CGLib proxy instance.

Method Summary

Modifier and TypeMethod and Description
public Object
intercept(final Object object, final Method method, final Object[] args, final MethodProxy methodProxy)

Implements net.sf.cglib.proxy.MethodInterceptor.intercept.

All generated proxied methods call this method instead of the original method.

Inherited from org.apache.commons.pool2.proxy.BaseProxyHandler:
disableProxydoInvokegetPooledObjecttoStringvalidateProxiedObject

Constructor Detail

CglibProxyHandlerback to summary
pack-priv CglibProxyHandler(final T pooledObject, final UsageTracking<T> usageTracking)

Constructs a CGLib proxy instance.

Parameters
pooledObject:T

The object to wrap

usageTracking:UsageTracking<T>

The instance, if any (usually the object pool) to be provided with usage tracking information for this wrapped object

Method Detail

interceptback to summary
public Object intercept(final Object object, final Method method, final Object[] args, final MethodProxy methodProxy) throws Throwable

Implements net.sf.cglib.proxy.MethodInterceptor.intercept.

Doc from net.sf.cglib.proxy.MethodInterceptor.intercept.

All generated proxied methods call this method instead of the original method. The original method may either be invoked by normal reflection using the Method object, or by using the MethodProxy (faster).

Annotations
@Override
Exceptions
Throwable:
any exception may be thrown; if so, super method will not be invoked