org.ow2.jonas.jndi.interceptors.impl.datasource
Class ConnectionProxy
java.lang.Object
org.ow2.jonas.jndi.interceptors.impl.datasource.ConnectionProxy
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
public class ConnectionProxy
- extends java.lang.Object
- implements java.lang.reflect.InvocationHandler
Invocation handler that will monitor the calls to the stop() method.
- Author:
- Florent Benoit
|
Constructor Summary |
ConnectionProxy(java.lang.Long id,
DatasourceWrapper datasourceWrapper,
java.sql.Connection wrappedConnection,
java.lang.StackTraceElement[] stackTraceElements)
Constructor of the handler of the proxy. |
|
Method Summary |
protected java.lang.Long |
getId()
|
protected java.lang.StackTraceElement[] |
getStackTraceElements()
|
protected java.sql.Connection |
getWrappedConnection()
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Intercept methods called on the connection object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionProxy
public ConnectionProxy(java.lang.Long id,
DatasourceWrapper datasourceWrapper,
java.sql.Connection wrappedConnection,
java.lang.StackTraceElement[] stackTraceElements)
- Constructor of the handler of the proxy.
- Parameters:
id - the given iddatasourceWrapper - the wrapped datasourcewrappedConnection - the wrapped connectionstackTraceElements - the stack trace
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.sql.SQLException,
java.lang.Throwable
- Intercept methods called on the connection object.
- Specified by:
invoke in interface java.lang.reflect.InvocationHandler
- Parameters:
proxy - the proxy instance that the method was invoked onmethod - the Method instance corresponding to the
interface method invoked on the proxy instance.args - an array of objects containing the values of the arguments
passed in the method invocation on the proxy instance, or
null if interface method takes no arguments.
- Returns:
- the value to return from the method invocation on the proxy
instance.
- Throws:
java.lang.Throwable - the exception to throw from the method invocation on
the proxy instance.
java.sql.SQLException
getId
protected java.lang.Long getId()
- Returns:
- id of this object.
getStackTraceElements
protected java.lang.StackTraceElement[] getStackTraceElements()
- Returns:
- stack trace elements.
getWrappedConnection
protected java.sql.Connection getWrappedConnection()
- Returns:
- wrapped connection.
Copyright © 2010 OW2 Consortium. All Rights Reserved.