|
Apache Tomcat 7.0.33 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.jdbc.pool.JdbcInterceptor
org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor
public abstract class AbstractCreateStatementInterceptor
Abstraction interceptor. This component intercepts all calls to create some type of SQL statement.
By extending this class, one can intercept queries and update statements by overriding the createStatement(Object, Method, Object[], Object, long)
method.
Field Summary | |
---|---|
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
|
Fields inherited from class org.apache.tomcat.jdbc.pool.JdbcInterceptor |
---|
CLOSE_VAL, EQUALS_VAL, GETCONNECTION_VAL, HASHCODE_VAL, ISCLOSED_VAL, ISVALID_VAL, ISWRAPPERFOR_VAL, properties, TOSTRING_VAL, UNWRAP_VAL |
Constructor Summary | |
---|---|
AbstractCreateStatementInterceptor()
|
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class org.apache.tomcat.jdbc.pool.JdbcInterceptor |
---|
compare, compare, disconnected, getNext, getProperties, isUseEquals, poolClosed, poolStarted, setNext, setProperties, setUseEquals |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public AbstractCreateStatementInterceptor()
Method Detail |
---|
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
public 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 created
Statement
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 recursion
protected boolean isExecute(java.lang.reflect.Method method, boolean process)
method
- the method being invoked on the proxyprocess
- boolean result used for recursion
protected 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 connection
|
Apache Tomcat 7.0.33 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |