protected Object getCreatedOrPreparedStatementSurrogate(
            final Method method, final Object[] args) throws Throwable {

        WrapperInvocationHandler handler;
        Object                   stmt = null;
        StatementKey             key  = new StatementKey(method, args);
        StatementPool            pool = this.statementPool;

        if (pool != null) {
            stmt = pool.checkOut(key);
        }

        if (stmt == null) {
            stmt = method.invoke(this.delegate, args);
        }

        handler              = new WrapperInvocationHandler(stmt, this);
        handler.statementKey = key;

        if (this.statements == null) {
            this.statements = new HashSet();
        }

        statements.add(handler);

        return handler.surrogate;
    }
protected Object getCreatedOrPreparedStatementSurrogate ( final Method method , final Object [ ] args ) throws Throwable { WrapperInvocationHandler handler ; Object stmt = null ; StatementKey key = new StatementKey ( method , args ) ; StatementPool pool = this . statementPool ; if ( pool != null ) { stmt = pool . checkOut ( key ) ; } if ( stmt == null ) { stmt = method . invoke ( this . delegate , args ) ; } handler = new WrapperInvocationHandler ( stmt , this ) ; handler . statementKey = key ; if ( this . statements == null ) { this . statements = new HashSet ( ) ; } statements . add ( handler ) ; return handler . surrogate ; }
Surrogate for any method of the delegate that returns an instance of
<tt>Statement</tt>. <p>

@param method returning instance of <tt>Statement</tt>
@param args to the method
@throws java.lang.Throwable the exception, if any, thrown by invoking
the given method with the given arguments upon the delegate
@return surrogate for the delegate Statement object