Class RunLevelServiceUtilities


  • public class RunLevelServiceUtilities
    extends Object
    Utilities for using the RunLevelService
    Author:
    jwells
    • Constructor Detail

      • RunLevelServiceUtilities

        public RunLevelServiceUtilities()
    • Method Detail

      • 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
      • 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