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

public Class JdkProxySource<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
java.lang.reflect.Proxy, java.util.Arrays, org.apache.commons.pool2.UsageTracking

Provides proxy objects using Java reflection.
Since
2.0

Field Summary

Modifier and TypeField and Description
private final ClassLoader
private final Class<?>[]

Constructor Summary

AccessConstructor and Description
public
JdkProxySource(final ClassLoader
The class loader with which to create the proxy
classLoader
,
final Class<?>[]
The interfaces to proxy
interfaces
)

Constructs a new proxy source for the given interfaces.

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

classLoaderback to summary
private final ClassLoader classLoader
interfacesback to summary
private final Class<?>[] interfaces

Constructor Detail

JdkProxySourceback to summary
public JdkProxySource(final ClassLoader classLoader, final Class<?>[] interfaces)

Constructs a new proxy source for the given interfaces.

Parameters
classLoader:ClassLoader

The class loader with which to create the proxy

interfaces:Class<?>[]

The interfaces 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
@SuppressWarnings:unchecked
@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