org.ow2.jonas.jndi.interceptors.impl.datasource
Class ConnectionProxy
java.lang.Object
org.ow2.jonas.jndi.interceptors.impl.datasource.ConnectionProxy
- All Implemented Interfaces:
- InvocationHandler
public class ConnectionProxy
- extends Object
- implements InvocationHandler
Invocation handler that will monitor the calls to the stop() method.
- Author:
- Florent Benoit
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionProxy
public ConnectionProxy(Long id,
DatasourceWrapper datasourceWrapper,
Connection wrappedConnection,
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 Object invoke(Object proxy,
Method method,
Object[] args)
throws SQLException,
Throwable
- Intercept methods called on the connection object.
- Specified by:
invoke in interface 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:
Throwable - the exception to throw from the method invocation on
the proxy instance.
SQLException
getId
protected Long getId()
- Returns:
- id of this object.
getStackTraceElements
protected StackTraceElement[] getStackTraceElements()
- Returns:
- stack trace elements.
getWrappedConnection
protected Connection getWrappedConnection()
- Returns:
- wrapped connection.
Copyright © 2011 OW2 Consortium. All Rights Reserved.