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

      public class JdkProxySource<T>
      extends Object

  Provides proxy objects using Java reflection.
  Since:
    2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JdkProxySource(ClassLoader classLoader, Class<?>[] interfaces)` Constructs a new proxy source for the given interfaces.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `createProxy(T pooledObject, UsageTracking<T> usageTracking)` Creates a new proxy object, wrapping the given pooled object.
    `T` | `resolveProxy(T proxy)` Resolves the wrapped object from the given proxy.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JdkProxySource

          public JdkProxySource(ClassLoader classLoader,
                                Class<?>[] interfaces)

      Constructs a new proxy source for the given interfaces.
      Parameters:
        `classLoader` - The class loader with which to create the proxy
        `interfaces` - The interfaces to proxy

  - ### Method Detail

    - #### createProxy

          public T createProxy(T pooledObject,
                               UsageTracking<T> usageTracking)

      Creates a new proxy object, wrapping the given pooled object.
      Parameters:
        `pooledObject` - The object to wrap
        `usageTracking` - 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)

      Resolves the wrapped object from the given proxy.
      Parameters:
        `proxy` - The proxy object
      Returns:
        The pooled object wrapped by the given proxy

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`
      Since:
        2.4.3

Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.