Package org.apache.tomcat.jdbc.pool
Class StatementFacade.StatementProxy
- java.lang.Object
-
- org.apache.tomcat.jdbc.pool.StatementFacade.StatementProxy
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
- Enclosing class:
- StatementFacade
protected class StatementFacade.StatementProxy extends java.lang.Object implements java.lang.reflect.InvocationHandlerProxy for a SQL statement. Refuses calls once the borrow that created it has ended, and seals every result set the statement hands back.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ObjectconnectionThe pooled connection the statement was created from, as reported byStatement.getConnection().protected java.lang.ObjectdelegateThe delegated statement, nulled once a close has been forwarded.protected java.lang.StringqueryThe SQL query text.
-
Constructor Summary
Constructors Constructor Description StatementProxy(java.lang.Object parent, java.lang.String query, java.lang.Object connection)Constructs a StatementProxy.
-
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
-
delegate
protected volatile java.lang.Object delegate
The delegated statement, nulled once a close has been forwarded. A handle can be closed from a thread other than the one invoking on it, so the field is read by more threads than the one that nulls it and, like the borrow-ended flag, must be volatile to reach them at all.
-
query
protected final java.lang.String query
The SQL query text.
-
connection
protected final java.lang.Object connection
The pooled connection the statement was created from, as reported byStatement.getConnection(). It is the handle the application borrowed, so it stops working once that borrow has been returned, while the driver's own connection would have gone on serving whoever borrowed the connection next.
-
-
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
-
-