@Contract public interface RunLevelListener
Instances of classes implementing this contract can be registered to be informed of events of RunLevelControllers.
Note that RunLevelController implementations may be asynchronous, so RunLevelListeners should be thread safe. Additionally, you are discouraged from performing lengthy operations in the listener since that may impact the performance of the RunLevelController calling the listener on the same thread.
Modifier and Type | Method and Description |
---|---|
void |
onCancelled(RunLevelFuture controller,
int levelAchieved)
Called when an RunLevelController implementation's proceedTo() operation
has been canceled for some reason
|
void |
onError(RunLevelFuture currentJob,
Throwable error)
Called when a service throws an exception during lifecycle
orchestration.
|
void |
onProgress(RunLevelFuture currentJob,
int levelAchieved)
Called when the RunLevelController advances to the next level
|
void onCancelled(RunLevelFuture controller, int levelAchieved)
currentJob
- the job currently runninglevelAchieved
- the level just achieved by the currentJob. Note
that if the currentJob is currently going up then the levelAchieved will
be the level for which all the services in that level were just started
while when going down the levelAchieved will be the level for which
all the services ABOVE that level have been shutdown. In both cases
the levelAchieved represents the current level of the systemvoid onError(RunLevelFuture currentJob, Throwable error)
controller
- the run level controllererror
- the error that was caughtvoid onProgress(RunLevelFuture currentJob, int levelAchieved)
currentJob
- the job currently runninglevelAchieved
- the level just achieved by the currentJob. Note
that if the currentJob is currently going up then the levelAchieved will
be the level for which all the services in that level were just started
while when going down the levelAchieved will be the level for which
all the services ABOVE that level have been shutdown. In both cases
the levelAchieved represents the current level of the systemCopyright © 2014 Oracle Corporation. All rights reserved.