org.glassfish.hk2.runlevel
Interface RunLevelListener


@Contract
public interface RunLevelListener

Implementations of RunLevelController should use this contract for publishing RunLevel events.

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.

Author:
jtrent, tbeerbower

Method Summary
 void onCancelled(RunLevelController controller, int previousProceedTo, boolean isInterrupt)
          Called when an RunLevelController implementation's proceedTo() operation has been canceled for some reason.
 void onError(RunLevelController controller, Throwable error, boolean willContinue)
          Called when a service throws an exception during lifecycle orchestration.
 void onProgress(RunLevelController controller)
          Called when the RunLevelController advances in some tangible way.
 

Method Detail

onCancelled

void onCancelled(RunLevelController controller,
                 int previousProceedTo,
                 boolean isInterrupt)
Called when an RunLevelController implementation's proceedTo() operation has been canceled for some reason. This could be as a result of a new proceedTo() call or an interrupt() for example.

Parameters:
controller - the run level controller
previousProceedTo - the previousProceedTo service that is being canceled
isInterrupt - set to true if the onCancelled even was as a result of an explicit interrupt() call

onError

void onError(RunLevelController controller,
             Throwable error,
             boolean willContinue)
Called when a service throws an exception during lifecycle orchestration.

Parameters:
controller - the run level controller
error - the error that was caught
willContinue - the flag indicating whether or not the RunLevelController plans to proceed thru to the planned RunLevel service

onProgress

void onProgress(RunLevelController controller)
Called when the RunLevelController advances in some tangible way.

Parameters:
controller - the run level controller


Copyright © 2013 Oracle Corporation. All Rights Reserved.