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

pack-priv 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 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
"this", the enhanced object
object
,
final Method
intercepted Method
method
,
final Object[]
argument array; primitive types are wrapped
args
,
final MethodProxy
used to invoke super (non-intercepted method); may be called as many times as needed
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).

Parameters
object:Object

"this", the enhanced object

method:Method

intercepted Method

args:Object[]

argument array; primitive types are wrapped

methodProxy:MethodProxy

used to invoke super (non-intercepted method); may be called as many times as needed

Returns:Object

any value compatible with the signature of the proxied method. Method returning void will ignore this value.

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