public interface SimpleService
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.
|
void start()
NodeState.STANDBY
state.
Leaves the service in the same state as demote()
.
Can only be called once.void promote()
NodeState.PRIMARY
state.
Can only be called on a started service (i.e. 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).void demote()
NodeState.STANDBY
state.
Can only be called on a started service (i.e. start()
must precede this method).
Can only be called in NodeState.PRIMARY
state (i.e. promote()
must precede this method).
Can be called multiple times (e.g. a service is promoted, then demoted, then promoted again,
and demoted again).void stop()
start()
has not been called on this service this method should be a noop.
Can only be called once.Copyright © 2023. All Rights Reserved.