Class RunLevelServiceUtilities

java.lang.Object
org.glassfish.hk2.runlevel.RunLevelServiceUtilities

public class RunLevelServiceUtilities extends Object
Utilities for using the RunLevelService
  • Constructor Details

    • RunLevelServiceUtilities

      public RunLevelServiceUtilities()
  • Method Details

    • enableRunLevelService

      public static void enableRunLevelService(ServiceLocator locator)
      Enables the RunLevelService in the given ServiceLocator. If the RunLevelContext 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 a RunLevel 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 a RunLevel scope annotation with the given value and mode
      Parameters:
      value - The value this RunLevel should take
      mode - The mode the RunLevel should take:
      • RUNLEVEL_MODE_VALIDATING
      • RUNLEVEL_MODE_NON_VALIDATING
      Returns:
      A RunLevel scope annotation