public class HostMonitoringConnectionPlugin extends AbstractConnectionPlugin implements CanReleaseResources
| Modifier and Type | Field and Description |
|---|---|
static AwsWrapperProperty |
FAILURE_DETECTION_COUNT |
static AwsWrapperProperty |
FAILURE_DETECTION_ENABLED |
static AwsWrapperProperty |
FAILURE_DETECTION_INTERVAL |
static AwsWrapperProperty |
FAILURE_DETECTION_TIME |
protected @NonNull java.util.Properties |
properties |
| Constructor and Description |
|---|
HostMonitoringConnectionPlugin(@NonNull PluginService pluginService,
@NonNull java.util.Properties properties)
Initialize the node monitoring plugin.
|
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
connect(@NonNull java.lang.String driverProtocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props,
boolean isInitialConnection,
@NonNull JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc) |
protected boolean |
doesNeedMonitoring(java.lang.String methodName)
Checks whether the JDBC method passed to this connection plugin requires monitoring.
|
<T,E extends java.lang.Exception> |
execute(java.lang.Class<T> resultClass,
java.lang.Class<E> exceptionClass,
java.lang.Object methodInvokeOn,
java.lang.String methodName,
JdbcCallable<T,E> jdbcMethodFunc,
java.lang.Object[] jdbcMethodArgs)
Executes the given SQL function with
MonitorImpl if connection monitoring is enabled. |
java.util.Set<java.lang.String> |
getSubscribedMethods() |
OldConnectionSuggestedAction |
notifyConnectionChanged(java.util.EnumSet<NodeChangeOptions> changes) |
void |
releaseResources()
Call this plugin's monitor service to release all resources associated with this plugin.
|
initHostProvider, notifyNodeListChangedpublic static final AwsWrapperProperty FAILURE_DETECTION_ENABLED
public static final AwsWrapperProperty FAILURE_DETECTION_TIME
public static final AwsWrapperProperty FAILURE_DETECTION_INTERVAL
public static final AwsWrapperProperty FAILURE_DETECTION_COUNT
protected @NonNull java.util.Properties properties
public HostMonitoringConnectionPlugin(@NonNull PluginService pluginService, @NonNull java.util.Properties properties)
pluginService - A service allowing the plugin to retrieve the current active connection
and its connection settings.properties - The property set used to initialize the active connection.public java.util.Set<java.lang.String> getSubscribedMethods()
getSubscribedMethods in interface ConnectionPlugingetSubscribedMethods in class AbstractConnectionPluginpublic <T,E extends java.lang.Exception> T execute(java.lang.Class<T> resultClass,
java.lang.Class<E> exceptionClass,
java.lang.Object methodInvokeOn,
java.lang.String methodName,
JdbcCallable<T,E> jdbcMethodFunc,
java.lang.Object[] jdbcMethodArgs)
throws E extends java.lang.Exception
MonitorImpl if connection monitoring is enabled.
Otherwise, executes the SQL function directly.execute in interface ConnectionPluginexecute in class AbstractConnectionPluginE extends java.lang.Exceptionprotected boolean doesNeedMonitoring(java.lang.String methodName)
methodName - Name of the JDBC method.public void releaseResources()
releaseResources in interface CanReleaseResourcespublic OldConnectionSuggestedAction notifyConnectionChanged(java.util.EnumSet<NodeChangeOptions> changes)
notifyConnectionChanged in interface ConnectionPluginnotifyConnectionChanged in class AbstractConnectionPluginpublic java.sql.Connection connect(@NonNull java.lang.String driverProtocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props,
boolean isInitialConnection,
@NonNull JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc)
throws java.sql.SQLException
connect in interface ConnectionPluginconnect in class AbstractConnectionPluginjava.sql.SQLException