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

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
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
)

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

Creates a new proxy object, wrapping the given pooled object.
public T
resolveProxy(final T
The proxy object
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.

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

Returns:T

the new proxy 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.

Parameters
proxy:T

The proxy object

Returns:T

The pooled object wrapped by 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.

Returns:String

a string representation of the object.

Annotations
@Override
Since
2.4.3