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>
Provides proxy objects using Java reflection.
- Since:
- 2.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJdkProxySource(ClassLoader classLoader, Class<?>[] interfaces) Constructs a new proxy source for the given interfaces. -
Method Summary
Modifier and TypeMethodDescriptioncreateProxy(T pooledObject, UsageTracking<T> usageTracking) Creates a new proxy object, wrapping the given pooled object.resolveProxy(T proxy) Resolves the wrapped object from the given proxy.toString()
-
Field Details
-
classLoader
-
interfaces
-
-
Constructor Details
-
JdkProxySource
Constructs a new proxy source for the given interfaces.- Parameters:
classLoader- The class loader with which to create the proxyinterfaces- The interfaces to proxy
-
-
Method Details
-
createProxy
Description copied from interface:ProxySourceCreates 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
Description copied from interface:ProxySourceResolves the wrapped object from the given proxy.- Specified by:
resolveProxyin interfaceProxySource<T>- Parameters:
proxy- The proxy object- Returns:
- The pooled object wrapped by the given proxy
-
toString
-