public interface Monitor
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDispose()
Defines whether this monitor can be disposed.
|
void |
close()
Closes all resources used by this monitor.
|
long |
getLastActivityTimestampNanos()
Gets the timestamp for the last action performed by this monitor, in nanoseconds.
|
MonitorState |
getState()
Gets the current state of this monitor.
|
void |
monitor()
Executes the monitoring loop for this monitor.
|
void |
start()
Submits this monitor in a separate thread to begin its monitoring tasks.
|
void |
stop()
Stops the monitoring tasks for this monitor and closes all resources.
|
void start()
void monitor()
start(). Additionally, the monitoring loop should regularly update the last
activity timestamp so that the MonitorService can detect whether the monitor is stuck or not.void stop()
void close()
stop().long getLastActivityTimestampNanos()
MonitorState getState()
boolean canDispose()