public class JvmMonitorService extends Object implements SimpleService
JvmMonitorService.Factory
.
This service creates and starts a JvmPauseMonitor
upon being started and stops said
pause monitor upon being stopped.Modifier and Type | Class and Description |
---|---|
static class |
JvmMonitorService.Factory
Factory that returns the appropriate
JvmMonitorService based on configuration. |
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
void |
demote()
Demotes the service back to
NodeState.STANDBY state. |
void |
promote()
Promotes the service to
NodeState.PRIMARY state. |
void |
start()
Starts the service.
|
void |
stop()
Stops the service altogether and cleans up any state left.
|
public void start()
SimpleService
NodeState.STANDBY
state.
Leaves the service in the same state as SimpleService.demote()
.
Can only be called once.start
in interface SimpleService
public void promote()
SimpleService
NodeState.PRIMARY
state.
Can only be called on a started service (i.e. SimpleService.start()
must precede this method).
Can only be called in NodeState.STANDBY
state.
Can be called multiple times (e.g. a service is promoted, then demoted, then promoted again).promote
in interface SimpleService
public void demote()
SimpleService
NodeState.STANDBY
state.
Can only be called on a started service (i.e. SimpleService.start()
must precede this method).
Can only be called in NodeState.PRIMARY
state (i.e. SimpleService.promote()
must precede this method).
Can be called multiple times (e.g. a service is promoted, then demoted, then promoted again,
and demoted again).demote
in interface SimpleService
public void stop()
SimpleService
SimpleService.start()
has not been called on this service this method should be a noop.
Can only be called once.stop
in interface SimpleService
Copyright © 2023. All Rights Reserved.