Interface RunLevelListener


  • @Contract
    public interface RunLevelListener
    Instances of classes implementing this contract can be registered with HK2 to be informed of events of RunLevelControllers.

    Lengthy operations should not be performed in the listener since that may impact the performance of the RunLevelController calling the listener.

    Author:
    jtrent, tbeerbower
    • Method Detail

      • onProgress

        void onProgress​(ChangeableRunLevelFuture currentJob,
                        int levelAchieved)
        Called when the RunLevelController advances to the next level

        Neither RunLevelController.proceedTo(int) nor RunLevelController.proceedToAsync(int) may be called from this method. However, ChangeableRunLevelFuture.changeProposedLevel(int) may be called

        Any exception thrown from this method is ignored

        Parameters:
        currentJob - the job currently running
        levelAchieved - the level just achieved by the currentJob. Note that if the currentJob is going up then the levelAchieved will be the level for which all the services in that level were just started. When going down the levelAchieved will be the level for which all the services ABOVE that level have been shutdown. In all cases the levelAchieved represents the current level of the system.
      • onCancelled

        void onCancelled​(RunLevelFuture currentJob,
                         int levelAchieved)
        Called when an RunLevelController implementation's proceedTo() operation has been canceled for some reason.

        Neither RunLevelController.proceedTo(int) nor RunLevelController.proceedToAsync(int) may be called from this method

        Any exception thrown from this method is ignored

        Parameters:
        currentJob - the job currently running
        levelAchieved - 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 system