| Constructor and Description |
|---|
MonitorImpl(@NonNull PluginService pluginService,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties properties,
long monitorDisposalTimeMillis,
@NonNull MonitorThreadContainer threadContainer)
Store the monitoring configuration for a connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearContexts()
Clear all
MonitorConnectionContext associated with this Monitor instance. |
boolean |
isStopped()
Whether this
Monitor has stopped monitoring a particular server. |
void |
run() |
protected void |
sleep(long duration)
Used to help with testing.
|
void |
startMonitoring(MonitorConnectionContext context) |
void |
stopMonitoring(MonitorConnectionContext context) |
public MonitorImpl(@NonNull PluginService pluginService, @NonNull HostSpec hostSpec, @NonNull java.util.Properties properties, long monitorDisposalTimeMillis, @NonNull MonitorThreadContainer threadContainer)
pluginService - A service for creating new connections.hostSpec - The HostSpec of the server this MonitorImpl
instance is monitoring.properties - The Properties containing additional monitoring
configuration.monitorDisposalTimeMillis - Time in milliseconds before stopping the monitoring thread
where there are no active connection to the server this
MonitorImpl instance is monitoring.threadContainer - A reference to the MonitorThreadContainer implementation
that initialized this class.public void startMonitoring(MonitorConnectionContext context)
startMonitoring in interface Monitorpublic void stopMonitoring(MonitorConnectionContext context)
stopMonitoring in interface Monitorpublic void clearContexts()
MonitorMonitorConnectionContext associated with this Monitor instance.clearContexts in interface Monitorpublic void run()
run in interface java.lang.Runnablepublic boolean isStopped()
MonitorMonitor has stopped monitoring a particular server.protected void sleep(long duration)
throws java.lang.InterruptedException
java.lang.InterruptedException