|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.monitor.db.ProxyConnection
public class ProxyConnection
This is a dynamic proxy for a JDBC connection which monitors together with
the ConnectionMonitor the different newInstance() and close() call.
Note: Since 1.4.2 this class was moved from package "patterntesting.runtime.db" to here.
| Constructor Summary | |
|---|---|
protected |
ProxyConnection(Connection connection)
Instantiates a new proxy connection. |
| Method Summary | |
|---|---|
StackTraceElement[] |
getCaller()
Gets the stacktrace of the caller. |
Connection |
getConnection()
Gets the wrapped connection. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Invokes the orginal Connection method and puts a wrapper around
Statement and PreparedStatement to support monitoring. |
static Connection |
newInstance(Connection connection)
Creates a new proxy instance for the given connection. |
String |
toString()
To string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected ProxyConnection(Connection connection)
newInstance(Connection) which is of no interest for us. We want
to store the real caller so we ignore the ProxyConnection class
but also the ProxyDriver class (ProxyDriver also calls this
constructor indirectly) and other non-interesting classes.
connection - the connection| Method Detail |
|---|
public static Connection newInstance(Connection connection)
connection - the connection
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
Connection method and puts a wrapper around
Statement and PreparedStatement to support monitoring.
TODO: CallableStatement is not yet wrapped.
invoke in interface InvocationHandlerproxy - the proxymethod - the methodargs - the args
Throwable - the throwableInvocationHandler.invoke(Object, Method, Object[])public Connection getConnection()
public StackTraceElement[] getCaller()
public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||