Class BaseProxyHandler<T>

    • Constructor Detail

      • BaseProxyHandler

        BaseProxyHandler​(T pooledObject,
                         UsageTracking<T> usageTracking)
        Constructs a new wrapper for 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
    • Method Detail

      • disableProxy

        T disableProxy()
        Disable the proxy wrapper. Called when the object has been returned to the pool. Further use of the wrapper should result in an IllegalStateException.
        Returns:
        the object that this proxy was wrapping
      • doInvoke

        Object doInvoke​(Method method,
                        Object[] args)
                 throws Throwable
        Invoke the given method on the wrapped object.
        Parameters:
        method - The method to invoke
        args - The arguments to the method
        Returns:
        The result of the method call
        Throws:
        Throwable - If the method invocation fails
      • getPooledObject

        T getPooledObject()
        Gets the wrapped, pooled object.
        Returns:
        the underlying pooled object