java.lang.Object
org.glassfish.hk2.runlevel.RunLevelServiceUtilities
Utilities for using the RunLevelService
- Author:
- jwells
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableRunLevelService(org.glassfish.hk2.api.ServiceLocator locator) Enables the RunLevelService in the givenServiceLocator.static RunLevelgetRunLevelAnnotation(int value) Returns aRunLevelscope annotation with the given value and RUNLEVEL_MODE_VALIDATING as the modestatic RunLevelgetRunLevelAnnotation(int value, int mode) Returns aRunLevelscope annotation with the given value and mode
-
Constructor Details
-
RunLevelServiceUtilities
public RunLevelServiceUtilities()
-
-
Method Details
-
enableRunLevelService
public static void enableRunLevelService(org.glassfish.hk2.api.ServiceLocator locator) Enables the RunLevelService in the givenServiceLocator. If theRunLevelContextis already registered then this method does nothing.All services needed by the RunLevelService feature are marked with
Serviceand hence would be automatically picked up in environments that use automatic service discovery- Parameters:
locator- the non-null service locator to add the run-level service to
-
getRunLevelAnnotation
Returns aRunLevelscope annotation with the given value and RUNLEVEL_MODE_VALIDATING as the mode- Parameters:
value- The value this RunLevel should take- Returns:
- A
RunLevelscope annotation
-
getRunLevelAnnotation
Returns aRunLevelscope annotation with the given value and mode- Parameters:
value- The value this RunLevel should takemode- The mode the RunLevel should take:- RUNLEVEL_MODE_VALIDATING
- RUNLEVEL_MODE_NON_VALIDATING
- Returns:
- A
RunLevelscope annotation
-