Annotation Interface RunLevel


@Documented @Retention(CLASS) @Target(TYPE) public @interface RunLevel
Indicates the desired startup sequence for a service class. This is not used internally by Injection, but is available as a convenience to the caller in support for a specific startup sequence for service activations.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    The service ranking applied when not declared explicitly.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Anything > 0 is left to the underlying provider implementation's discretion for meaning; this is just a default for something that is deemed "other than startup".
    static final int
    Represents an eager singleton that should be started at "startup".
  • Field Details

    • STARTUP

      static final int STARTUP
      Represents an eager singleton that should be started at "startup". Note, however, that callers control the actual activation for these services, not the framework itself, as shown below:
       
       List<ServiceProvider<Object>> startupServices = services
                     .lookup(ServiceInfoCriteria.builder().runLevel(RunLevel.STARTUP).build());
             startupServices.stream().forEach(ServiceProvider::get);
       
       
      See Also:
    • NORMAL

      static final int NORMAL
      Anything > 0 is left to the underlying provider implementation's discretion for meaning; this is just a default for something that is deemed "other than startup".
      See Also:
  • Element Details

    • value

      int value
      The service ranking applied when not declared explicitly.
      Returns:
      the startup int value, defaulting to NORMAL
      Default:
      100