public class NoopService extends Object implements SimpleService
Constructor and Description |
---|
NoopService() |
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.