java.sql.Connection object the
invoke(Object, Method, Object[]) method on the interceptor will be called.
Interceptors are useful to change or improve behavior of the connection pool.setProperties(Map) method.
Properties arrive in a key-value pair of Strings as they were received through the configuration.
This method is called once per cached connection object when the object is first configured.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CLOSE_VAL
|
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | ISCLOSED_VAL
|
| public static final String | ISVALID_VAL
|
| public static final String | |
| private volatile JdbcInterceptor | next
The next interceptor in the chain |
| protected Map | properties
Properties for this interceptor. |
| public static final String | TOSTRING_VAL
|
| public static final String | UNWRAP_VAL
|
| private boolean | useEquals
Property that decides how we do string comparison, default is to use
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | Returns: true if the name matchesThe method name methodName, Method The method method)Compares a method name (String) to a method (Method)
|
| public void | disconnected(ConnectionPool
- the connection pool that this connection belongs to parent, PooledConnection - the pooled connection that holds this connection con, boolean - if this connection is finalizing. True means that the pooled connection will not reconnect the underlying connection finalizing)Called when |
| public JdbcInterceptor | |
| public Map | Returns: the configured properties for this interceptorReturns the properties configured for this interceptor |
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Gets invoked each time an operation on |
| public boolean | Returns: true if the compare method uses the Object.equals(Object) method false if comparison is done on a reference level
|
| public void | poolClosed(ConnectionPool
- the pool that is being closed. pool)This method is invoked by a connection pool when the pool is closed. |
| public void | poolStarted(ConnectionPool
- the pool that is being closed. pool)This method is invoked by a connection pool when the pool is first started up, usually when the first connection is requested. |
| public abstract void | reset(ConnectionPool
- the connection pool owning the connection parent, PooledConnection - the pooled connection con)Gets called each time the connection is borrowed from the pool This means that if an interceptor holds a reference to the connection the interceptor can be reused for another connection. |
| public void | |
| public void | setProperties(Map<String, PoolProperties.
The properties propertiesCalled during the creation of an interceptor The properties can be set during the configuration of an interceptor Override this method to perform type casts between string values and object properties |
| public void | setUseEquals(boolean
true if equals will be used for comparisonsSet to true if string comparisons (for the |
| CLOSE_VAL | back to summary |
|---|---|
| public static final String CLOSE_VAL
| |
| EQUALS_VAL | back to summary |
|---|---|
| public static final String EQUALS_VAL | |
| GETCONNECTION_VAL | back to summary |
|---|---|
| public static final String GETCONNECTION_VAL
| |
| HASHCODE_VAL | back to summary |
|---|---|
| public static final String HASHCODE_VAL | |
| ISCLOSED_VAL | back to summary |
|---|---|
| public static final String ISCLOSED_VAL
| |
| ISVALID_VAL | back to summary |
|---|---|
| public static final String ISVALID_VAL
| |
| ISWRAPPERFOR_VAL | back to summary |
|---|---|
| public static final String ISWRAPPERFOR_VAL
| |
| next | back to summary |
|---|---|
| private volatile JdbcInterceptor next The next interceptor in the chain | |
| properties | back to summary |
|---|---|
| protected Map<String, PoolProperties. Properties for this interceptor. | |
| TOSTRING_VAL | back to summary |
|---|---|
| public static final String TOSTRING_VAL
| |
| UNWRAP_VAL | back to summary |
|---|---|
| public static final String UNWRAP_VAL
| |
| useEquals | back to summary |
|---|---|
| private boolean useEquals Property that decides how we do string comparison, default is to use
| |
| JdbcInterceptor | back to summary |
|---|---|
| public JdbcInterceptor() Public constructor for instantiation through reflection | |
| compare | back to summary |
|---|---|
| public boolean compare(String name1, String name2) Performs a string comparison, using references unless the useEquals property is set to true. | |
| compare | back to summary |
|---|---|
| public boolean compare(String methodName, Method method) Compares a method name (String) to a method (Method)
| |
| disconnected | back to summary |
|---|---|
| public void disconnected(ConnectionPool parent, PooledConnection con, boolean finalizing) Called when
| |
| getNext | back to summary |
|---|---|
| public JdbcInterceptor getNext() Returns the next interceptor in the chain
| |
| getProperties | back to summary |
|---|---|
| public Map Returns the properties configured for this interceptor
| |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Gets invoked each time an operation on
| |
| isUseEquals | back to summary |
|---|---|
public boolean isUseEquals()
| |
| poolClosed | back to summary |
|---|---|
| public void poolClosed(ConnectionPool pool) This method is invoked by a connection pool when the pool is closed. Interceptor classes can override this method if they keep static variables or other tracking means around. This method is only invoked on a single instance of the interceptor, and not on every instance created.
| |
| poolStarted | back to summary |
|---|---|
| public void poolStarted(ConnectionPool pool) This method is invoked by a connection pool when the pool is first started up, usually when the first connection is requested. Interceptor classes can override this method if they keep static variables or other tracking means around. This method is only invoked on a single instance of the interceptor, and not on every instance created.
| |
| reset | back to summary |
|---|---|
| public abstract void reset(ConnectionPool parent, PooledConnection con) Gets called each time the connection is borrowed from the pool
This means that if an interceptor holds a reference to the connection
the interceptor can be reused for another connection.
| |
| setNext | back to summary |
|---|---|
| public void setNext(JdbcInterceptor next) configures the next interceptor in the chain
| |
| setProperties | back to summary |
|---|---|
| public void setProperties(Map<String, PoolProperties. Called during the creation of an interceptor The properties can be set during the configuration of an interceptor Override this method to perform type casts between string values and object properties
| |
| setUseEquals | back to summary |
|---|---|
| public void setUseEquals(boolean useEquals) Set to true if string comparisons (for the
| |