|
||||||||||
| 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,
ServiceContext ctx,
int previousProceedTo,
boolean isInterrupt)
Called when an RunLevelService implementation's proceedTo() operation has been canceled for some reason. |
void |
onError(RunLevelState<?> state,
ServiceContext context,
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,
ServiceContext ctx,
int previousProceedTo,
boolean isInterrupt)
state - the current and new planned statectx - the context of the inhabitant that was is the midst of being processed at the time of the cancel
if this information is available, null otherwisepreviousProceedTo - the previousProceedTo state that is
being canceled. (This should always be != state.plannedRunLevel)boolean - isInterrupt set to true if the onCancelled even was as
a result of an explicit interrupt() call.
void onError(RunLevelState<?> state,
ServiceContext context,
Throwable error,
boolean willContinue)
state - the current RunLevelService state successfully achievedcontext - 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 | |||||||||