org.firebirdsql.pool
Class StatementHandler
java.lang.Object
org.firebirdsql.pool.StatementHandler
- InvocationHandler
public class StatementHandler
extends java.lang.Object
implements InvocationHandler
Dynamic proxy handler that together with org.firebirdsql.pool.PooledConnectionHandler
ensure that statements will be closed before connection is returned to the
pool.
StatementHandler(org.firebirdsql.pool.PooledConnectionHandler connectionHandler, Statement wrappedObject) - Create instance of this class for the specified connection handler and
|
Statement | getProxy() - Get dynamic proxy instant wrapping the statement.
|
Statement | getWrappedObject() - Get original statement that was wrapped.
|
Object | invoke(Object proxy, Method method, Object[] args) - Invoke a specified method with the specified arguments on the specified
proxy.
|
StatementHandler
public StatementHandler(org.firebirdsql.pool.PooledConnectionHandler connectionHandler,
Statement wrappedObject)
Create instance of this class for the specified connection handler and
connectionHandler
- instance of PooledConnectionHandler
that is
responsible for a connection that created a statement to wrap.wrappedObject
- instance of Statement
to wrap.
getProxy
public Statement getProxy()
Get dynamic proxy instant wrapping the statement.
getWrappedObject
public Statement getWrappedObject()
Get original statement that was wrapped.
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
Invoke a specified method with the specified arguments on the specified
proxy. This method checks if Statement.close()
is called
and de-registers the statement from automatic close on connection close.
proxy
- proxy, on which the method was called.method
- method that was invoked.args
- arguments that were passed to the method.
- object that was returned by the method.
Copyright B) 2001 David Jencks and other authors. All rights reserved.