public abstract class AbstractCreateStatementInterceptor extends JdbcInterceptor
createStatement(Object, Method, Object[], Object, long)
method.Modifier and Type | Field and Description |
---|---|
protected static java.lang.reflect.Constructor<?>[] |
constructors
the constructors that are used to create statement proxies
|
protected static java.lang.String |
CREATE_STATEMENT |
protected static int |
CREATE_STATEMENT_IDX |
protected static java.lang.String |
EXECUTE |
protected static java.lang.String |
EXECUTE_BATCH |
protected static java.lang.String |
EXECUTE_QUERY |
protected static java.lang.String[] |
EXECUTE_TYPES |
protected static java.lang.String |
EXECUTE_UPDATE |
protected static java.lang.String |
PREPARE_CALL |
protected static int |
PREPARE_CALL_IDX |
protected static java.lang.String |
PREPARE_STATEMENT |
protected static int |
PREPARE_STATEMENT_IDX |
protected static int |
STATEMENT_TYPE_COUNT |
protected static java.lang.String[] |
STATEMENT_TYPES |
CLOSE_VAL, EQUALS_VAL, GETCONNECTION_VAL, HASHCODE_VAL, ISCLOSED_VAL, ISVALID_VAL, ISWRAPPERFOR_VAL, properties, TOSTRING_VAL, UNWRAP_VAL
Constructor and Description |
---|
AbstractCreateStatementInterceptor() |
Modifier and Type | Method and Description |
---|---|
abstract void |
closeInvoked()
Method invoked when the operation
Connection.close() is invoked. |
abstract java.lang.Object |
createStatement(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object statement,
long time)
This method will be invoked after a successful statement creation.
|
protected java.lang.reflect.Constructor<?> |
getConstructor(int idx,
java.lang.Class<?> clazz)
Creates a constructor for a proxy class, if one doesn't already exist
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Gets invoked each time an operation on
Connection is invoked. |
protected boolean |
isExecute(java.lang.reflect.Method method,
boolean process)
Returns true if the method that is being invoked matches one of the execute types.
|
protected boolean |
isStatement(java.lang.reflect.Method method,
boolean process)
Returns true if the method that is being invoked matches one of the statement types.
|
protected boolean |
process(java.lang.String[] names,
java.lang.reflect.Method method,
boolean process) |
void |
reset(ConnectionPool parent,
PooledConnection con)
no-op for this interceptor. no state is stored.
|
compare, compare, disconnected, getNext, getProperties, isUseEquals, poolClosed, poolStarted, setNext, setProperties, setUseEquals
protected static final java.lang.String CREATE_STATEMENT
protected static final int CREATE_STATEMENT_IDX
protected static final java.lang.String PREPARE_STATEMENT
protected static final int PREPARE_STATEMENT_IDX
protected static final java.lang.String PREPARE_CALL
protected static final int PREPARE_CALL_IDX
protected static final java.lang.String[] STATEMENT_TYPES
protected static final int STATEMENT_TYPE_COUNT
protected static final java.lang.String EXECUTE
protected static final java.lang.String EXECUTE_QUERY
protected static final java.lang.String EXECUTE_UPDATE
protected static final java.lang.String EXECUTE_BATCH
protected static final java.lang.String[] EXECUTE_TYPES
protected static final java.lang.reflect.Constructor<?>[] constructors
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
Connection
is invoked.
invoke
in interface java.lang.reflect.InvocationHandler
invoke
in class JdbcInterceptor
java.lang.Throwable
protected java.lang.reflect.Constructor<?> getConstructor(int idx, java.lang.Class<?> clazz) throws java.lang.NoSuchMethodException
idx
- - the index of the constructorclazz
- - the interface that the proxy will implementjava.lang.NoSuchMethodException
- Constructor not foundpublic abstract java.lang.Object createStatement(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object statement, long time)
Statement
, PreparedStatement
or CallableStatement
proxy
- the actual proxy objectmethod
- the method that was called. It will be one of the methods defined in STATEMENT_TYPES
args
- the arguments to the methodstatement
- the statement that the underlying connection createdStatement
objectpublic abstract void closeInvoked()
Connection.close()
is invoked.protected boolean isStatement(java.lang.reflect.Method method, boolean process)
method
- the method being invoked on the proxyprocess
- boolean result used for recursionprotected boolean isExecute(java.lang.reflect.Method method, boolean process)
method
- the method being invoked on the proxyprocess
- boolean result used for recursionprotected boolean process(java.lang.String[] names, java.lang.reflect.Method method, boolean process)
public void reset(ConnectionPool parent, PooledConnection con)
reset
in class JdbcInterceptor
parent
- - the connection pool owning the connectioncon
- - the pooled connectionCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.