public class HostMonitorImpl extends java.lang.Object implements HostMonitor
Connection.| Constructor and Description |
|---|
HostMonitorImpl(@NonNull PluginService pluginService,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties properties,
long monitorDisposalTimeMillis,
@NonNull HostMonitorThreadContainer threadContainer)
Store the monitoring configuration for a connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearContexts()
Clear all
HostMonitorConnectionContext associated with this HostMonitor instance. |
boolean |
isStopped()
Whether this
HostMonitor has stopped monitoring a particular server. |
void |
run() |
protected void |
sleep(long duration)
Used to help with testing.
|
void |
startMonitoring(HostMonitorConnectionContext context) |
void |
stopMonitoring(HostMonitorConnectionContext context) |
public HostMonitorImpl(@NonNull PluginService pluginService, @NonNull HostSpec hostSpec, @NonNull java.util.Properties properties, long monitorDisposalTimeMillis, @NonNull HostMonitorThreadContainer threadContainer)
pluginService - A service for creating new connections.hostSpec - The HostSpec of the server this HostMonitorImpl
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
HostMonitorImpl instance is monitoring.threadContainer - A reference to the HostMonitorThreadContainer implementation
that initialized this class.public void startMonitoring(HostMonitorConnectionContext context)
startMonitoring in interface HostMonitorpublic void stopMonitoring(HostMonitorConnectionContext context)
stopMonitoring in interface HostMonitorpublic void clearContexts()
HostMonitorHostMonitorConnectionContext associated with this HostMonitor instance.clearContexts in interface HostMonitorpublic void run()
run in interface java.lang.Runnablepublic boolean isStopped()
HostMonitorHostMonitor has stopped monitoring a particular server.isStopped in interface HostMonitorprotected void sleep(long duration)
throws java.lang.InterruptedException
duration - Duration of sleep in millis.java.lang.InterruptedException - is thread is interrupted