Package org.glassfish.hk2.runlevel
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onCancelled
(RunLevelFuture currentJob, int levelAchieved) Called when an RunLevelController implementation's proceedTo() operation has been canceled for some reason.void
onError
(RunLevelFuture currentJob, ErrorInformation errorInformation) Called when a service throws an exception during a proceedTo operationvoid
onProgress
(ChangeableRunLevelFuture currentJob, int levelAchieved) Called when the RunLevelController advances to the next level
-
Method Details
-
onProgress
Called when the RunLevelController advances to the next levelNeither
RunLevelController.proceedTo(int)
norRunLevelController.proceedToAsync(int)
may be called from this method. However,ChangeableRunLevelFuture.changeProposedLevel(int)
may be calledAny exception thrown from this method is ignored
- Parameters:
currentJob
- the job currently runninglevelAchieved
- 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
Called when an RunLevelController implementation's proceedTo() operation has been canceled for some reason.Neither
RunLevelController.proceedTo(int)
norRunLevelController.proceedToAsync(int)
may be called from this methodAny exception thrown from this method is ignored
- Parameters:
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 system
-
onError
Called when a service throws an exception during a proceedTo operationNeither
RunLevelController.proceedTo(int)
norRunLevelController.proceedToAsync(int)
may be called from this methodAny exception thrown from this method is ignored
- Parameters:
currentJob
- the run level controllererrorInformation
- information about the error that had been caught
-