Class StatementFinalizer.CloseAwareProxy

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler
    Enclosing class:
    StatementFinalizer

    protected class StatementFinalizer.CloseAwareProxy
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Thin proxy around a tracked statement. Every call is delegated unchanged; only close() is reacted to, by forgetting the tracked entry so that a statement the application closed properly neither lingers in the list nor is touched again when the connection is returned.

    Object.equals(Object) and hashCode() are answered on the handle itself, as ProxyConnection and the pool's other statement proxies answer them: the handle equals only itself and hashes at its own identity, so a container holding it next to an unwrapped handle for the same statement holds two elements whichever of the two arrived first. Reaching the statement underneath is unwrap's purpose, and there the driver's own equality applies.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloseAwareProxy

        public CloseAwareProxy​(StatementFinalizer.StatementEntry entry)
        Creates a handler for the given tracked statement.
        Parameters:
        entry - the list entry tracking the statement
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable