|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Contract public interface RunLevelListener
Implementations of RunLevelService are encouraged to use this contract for publishing RunLevel events.
Instances of classes implementing this contract can be registered into the habitat to be informed of events of RunLevelServices within the same habitat.
Note that RunLevelService 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 RunLevelService calling the listener on the same thread.
All RunLevelListeners get called for all RunLevel events on the same habitat. It is therefore the caller's responsibility to distinguish the RunLevelState(s) of their interest.
| Method Summary | |
|---|---|
void |
onCancelled(RunLevelState<?> state,
int previousProceedTo)
Called when an asynchronous RunLevelService implementation's proceedTo() operation has been interrupted with a new proceedTo() call. |
void |
onError(RunLevelState<?> state,
ServiceContext context,
java.lang.Throwable error,
boolean willContinue)
Called when a service throws an exception during lifecycle orchestration. |
void |
onProgress(RunLevelState<?> state)
Called when the RunLevelService advances in some tangible way. |
| Method Detail |
|---|
void onCancelled(RunLevelState<?> state,
int previousProceedTo)
state - the current and new planned statepreviousProceedTo - the previousProceedTo state that is
being interrupted. This should always be != state.plannedRunLevel
void onError(RunLevelState<?> state,
ServiceContext context,
java.lang.Throwable error,
boolean willContinue)
state - the RunLevelService's statecontext - the of the failure (may be null)error - the error that was caughtwillContinue - the flag indicating whether or not the RunLevelService
plans to proceed thru to the planned RunLevel state.void onProgress(RunLevelState<?> state)
state - the RunLevelService's state
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||