public class NodeMonitoringConnectionPlugin extends java.lang.Object implements IConnectionPlugin
| Modifier and Type | Field and Description |
|---|---|
protected Log |
logger |
protected IConnectionPlugin |
nextPlugin |
protected PropertySet |
propertySet |
| Constructor and Description |
|---|
NodeMonitoringConnectionPlugin(ICurrentConnectionProvider currentConnectionProvider,
PropertySet propertySet,
IConnectionPlugin nextPlugin,
Log logger)
Initialize the node monitoring plugin.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doesNeedMonitoring(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName)
Checks whether the JDBC method passed to this connection plugin requires monitoring.
|
java.lang.Object |
execute(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName,
java.util.concurrent.Callable<?> executeSqlFunc)
Executes the given SQL function with
Monitor if connection monitoring is enabled. |
void |
releaseResources()
Call this plugin's monitor service to release all resources associated with this
plugin.
|
protected IConnectionPlugin nextPlugin
protected Log logger
protected PropertySet propertySet
public NodeMonitoringConnectionPlugin(ICurrentConnectionProvider currentConnectionProvider, PropertySet propertySet, IConnectionPlugin nextPlugin, Log logger)
currentConnectionProvider - A provider allowing the plugin to retrieve the
current active connection and its connection settings.propertySet - The property set used to initialize the active connection.nextPlugin - The next connection plugin in the chain.logger - An implementation of Log.public java.lang.Object execute(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName,
java.util.concurrent.Callable<?> executeSqlFunc)
throws java.lang.Exception
Monitor if connection monitoring is enabled.
Otherwise, executes the SQL function directly.execute in interface IConnectionPluginmethodInvokeOn - Class of an object that method to monitor to be invoked on.methodName - Name of the method to monitor.executeSqlFunc - Callable SQL function.Callable SQL function.java.lang.Exception - if an error occurs.protected boolean doesNeedMonitoring(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName)
methodInvokeOn - The class of the JDBC method.methodName - Name of the JDBC method.public void releaseResources()
releaseResources in interface IConnectionPlugin