Package org.apache.commons.pool2.proxy
Class JdkProxySource<T>
- java.lang.Object
-
- org.apache.commons.pool2.proxy.JdkProxySource<T>
-
- Type Parameters:
T- type of the pooled object to be proxied
- All Implemented Interfaces:
ProxySource<T>
public class JdkProxySource<T> extends java.lang.Object implements ProxySource<T>
Provides proxy objects using Java reflection.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderprivate java.lang.Class<?>[]interfaces
-
Constructor Summary
Constructors Constructor Description JdkProxySource(java.lang.ClassLoader classLoader, java.lang.Class<?>[] interfaces)Create a new proxy source for the given interfaces.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TcreateProxy(T pooledObject, UsageTracking<T> usageTracking)Create a new proxy object, wrapping the given pooled object.TresolveProxy(T proxy)Obtain the wrapped object from the given proxy.
-
-
-
Method Detail
-
createProxy
public T createProxy(T pooledObject, UsageTracking<T> usageTracking)
Description copied from interface:ProxySourceCreate a new proxy object, wrapping the given pooled object.- Specified by:
createProxyin interfaceProxySource<T>- Parameters:
pooledObject- The object to wrapusageTracking- The instance, if any (usually the object pool) to be provided with usage tracking information for this wrapped object- Returns:
- the new proxy object
-
resolveProxy
public T resolveProxy(T proxy)
Description copied from interface:ProxySourceObtain the wrapped object from the given proxy.- Specified by:
resolveProxyin interfaceProxySource<T>- Parameters:
proxy- The proxy object- Returns:
- The pooled objetc wrapped by the given proxy
-
-