Package org.apache.tomcat.jdbc.pool
Class TrapException
- java.lang.Object
-
- org.apache.tomcat.jdbc.pool.JdbcInterceptor
-
- org.apache.tomcat.jdbc.pool.TrapException
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
public class TrapException extends JdbcInterceptor
Interceptor that traps any unhandled exception types and throws an exception that has been declared by the method called, or throw a SQLException if it is declared. If the caught exception is not declared, and the method doesn't throw SQLException, then this interceptor will throw a RuntimeException
-
-
Field Summary
-
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
Constructors Constructor Description TrapException()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)Gets invoked each time an operation onConnectionis invoked.booleanisDeclaredException(java.lang.reflect.Method m, java.lang.Class<?> clazz)voidreset(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
-
-
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.ThrowableDescription copied from class:JdbcInterceptorGets invoked each time an operation onConnectionis invoked.- Specified by:
invokein interfacejava.lang.reflect.InvocationHandler- Overrides:
invokein classJdbcInterceptor- Throws:
java.lang.Throwable
-
isDeclaredException
public boolean isDeclaredException(java.lang.reflect.Method m, java.lang.Class<?> clazz)
-
reset
public void reset(ConnectionPool parent, PooledConnection con)
no-op for this interceptor. no state is stored.- Specified by:
resetin classJdbcInterceptor- Parameters:
parent- - the connection pool owning the connectioncon- - the pooled connection
-
-