Interface ProxySource<T>

  • Type Parameters:
    T - type of the pooled object to be proxied
    All Known Implementing Classes:
    CglibProxySource, JdkProxySource

    interface ProxySource<T>
    The interface that any provide of proxy instances must implement to allow the ProxiedObjectPool to create proxies as required.
    Since:
    2.0
    • Method Detail

      • createProxy

        T createProxy​(T pooledObject,
                      UsageTracking<T> usageTracking)
        Create 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

        T resolveProxy​(T proxy)
        Obtain the wrapped object from the given proxy.
        Parameters:
        proxy - The proxy object
        Returns:
        The pooled objetc wrapped by the given proxy