Class AbstractQueryReport.StatementProxy

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

    protected class AbstractQueryReport.StatementProxy
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Class to measure query execute time
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean closed
      Indicates whether the proxy has been closed.
      protected java.lang.Object delegate
      The statement being proxied, or a further interceptor's proxy of it, nulled once a close has been forwarded.
      protected java.lang.String query
      The SQL the statement was prepared with, or null when it was created without one.
    • Constructor Summary

      Constructors 
      Constructor Description
      StatementProxy​(java.lang.Object parent, java.lang.String query)
      Constructs a new StatementProxy.
    • Method Summary

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

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • closed

        protected volatile boolean closed
        Indicates whether the proxy has been closed. A statement can be closed from a thread other than the one executing on it - the statement finalizer closes tracked statements from whichever thread closes the connection - so the flag is written by one thread and read by others, and must be volatile to reach them at all.
      • delegate

        protected volatile java.lang.Object delegate
        The statement being proxied, or a further interceptor's proxy of it, nulled once a close has been forwarded. It is read by threads other than the one that nulls it, so, like closed, volatile.
      • query

        protected final java.lang.String query
        The SQL the statement was prepared with, or null when it was created without one.
    • Constructor Detail

      • StatementProxy

        public StatementProxy​(java.lang.Object parent,
                              java.lang.String query)
        Constructs a new StatementProxy.
        Parameters:
        parent - The statement being proxied, or a further interceptor's proxy of it
        query - The SQL the statement was prepared with, or null when it was created without one
    • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object