Class AbstractQueryReport.StatementProxy
- java.lang.Object
-
- org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport.StatementProxy
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
- Enclosing class:
- AbstractQueryReport
protected class AbstractQueryReport.StatementProxy extends java.lang.Object implements java.lang.reflect.InvocationHandlerClass to measure query execute time
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosedIndicates whether the proxy has been closed.protected java.lang.ObjectdelegateThe statement being proxied, or a further interceptor's proxy of it, nulled once a close has been forwarded.protected java.lang.StringqueryThe SQL the statement was prepared with, ornullwhen it was created without one.
-
Constructor Summary
Constructors Constructor Description StatementProxy(java.lang.Object parent, java.lang.String query)Constructs a newStatementProxy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)java.lang.StringtoString()
-
-
-
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, likeclosed, volatile.
-
query
protected final java.lang.String query
The SQL the statement was prepared with, ornullwhen it was created without one.
-
-
Constructor Detail
-
StatementProxy
public StatementProxy(java.lang.Object parent, java.lang.String query)Constructs a newStatementProxy.- Parameters:
parent- The statement being proxied, or a further interceptor's proxy of itquery- The SQL the statement was prepared with, ornullwhen 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:
invokein interfacejava.lang.reflect.InvocationHandler- Throws:
java.lang.Throwable
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-