public class MethodCountConnectionPlugin extends java.lang.Object implements IConnectionPlugin
All connection plugins must implement the IConnectionPlugin
interface. Since
all the connection plugins are chained together, the prior connection plugin needs to
invoke the next plugin.
Once registered, every connection will create an instance of this connection plugin.
Constructor and Description |
---|
MethodCountConnectionPlugin(IConnectionPlugin nextPlugin,
Log logger) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName,
java.util.concurrent.Callable<?> executeJdbcMethod,
java.lang.Object[] args)
All method calls related to the connection object will be passed to this method as
Callable<?> executeJdbcMethod . |
void |
openInitialConnection(ConnectionUrl connectionUrl) |
void |
releaseResources()
This method is called when the connection closes.
|
void |
transactionBegun()
Called when the driver has been told by the server that a transaction is now in progress (when
one has not been currently in progress).
|
void |
transactionCompleted()
Called when the driver has been told by the server that a transaction has completed, and no
transaction is currently in progress.
|
public MethodCountConnectionPlugin(IConnectionPlugin nextPlugin, Log logger)
public java.lang.Object execute(java.lang.Class<?> methodInvokeOn, java.lang.String methodName, java.util.concurrent.Callable<?> executeJdbcMethod, java.lang.Object[] args) throws java.lang.Exception
Callable<?> executeJdbcMethod
.
This includes methods that may be called frequently, such as:
ResultSet.next()
ResultSet.getString(int)
execute
in interface IConnectionPlugin
java.lang.Exception
public void transactionBegun()
ITransactionContextHandler
transactionBegun
in interface ITransactionContextHandler
public void transactionCompleted()
ITransactionContextHandler
transactionCompleted
in interface ITransactionContextHandler
public void openInitialConnection(ConnectionUrl connectionUrl) throws java.sql.SQLException
openInitialConnection
in interface IConnectionPlugin
java.sql.SQLException
public void releaseResources()
releaseResources
in interface IConnectionPlugin