Package org.glassfish.hk2.runlevel
Class RunLevelServiceUtilities
- java.lang.Object
-
- org.glassfish.hk2.runlevel.RunLevelServiceUtilities
-
public class RunLevelServiceUtilities extends java.lang.Object
Utilities for using the RunLevelService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RunLevelServiceUtilities.RunLevelImpl
-
Constructor Summary
Constructors Constructor Description RunLevelServiceUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
enableRunLevelService(ServiceLocator locator)
Enables the RunLevelService in the givenServiceLocator
.static RunLevel
getRunLevelAnnotation(int value)
Returns aRunLevel
scope annotation with the given value and RUNLEVEL_MODE_VALIDATING as the modestatic RunLevel
getRunLevelAnnotation(int value, int mode)
Returns aRunLevel
scope annotation with the given value and modeprivate static boolean
isDupException(MultiException me)
-
-
-
Method Detail
-
enableRunLevelService
public static void enableRunLevelService(ServiceLocator locator)
Enables the RunLevelService in the givenServiceLocator
. If theRunLevelContext
is already registered then this method does nothing.All services needed by the RunLevelService feature are marked with
Service
and 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
-
isDupException
private static boolean isDupException(MultiException me)
-
getRunLevelAnnotation
public static RunLevel getRunLevelAnnotation(int value)
Returns aRunLevel
scope annotation with the given value and RUNLEVEL_MODE_VALIDATING as the mode- Parameters:
value
- The value this RunLevel should take- Returns:
- A
RunLevel
scope annotation
-
getRunLevelAnnotation
public static RunLevel getRunLevelAnnotation(int value, int mode)
Returns aRunLevel
scope 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
RunLevel
scope annotation
-
-