Annotation Interface ModuleTask


@Documented @Target(METHOD) @Retention(RUNTIME) public @interface ModuleTask
Represents a method that a module can specify. A method annotated with this annotation is captured during the runtime in the module task entry. These methods are like startup and stop methods and are invoked when the module switches to the specified module lifecycle.

The dependencies of a module are loaded for the first time in the ModuleLifeCycle.STARTED lifecycle. All module tasks that target the ModuleLifeCycle.UNUSABLE lifecycle are never invoked.

Since:
4.0
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Get the module lifecycle in which this task should be fired.
    byte
    Get the order of this task to be fired within the other task in the same lifecycle.
  • Element Details

    • order

      byte order
      Get the order of this task to be fired within the other task in the same lifecycle. If two tasks with the same lifecycle target and order are defined, the sort operation will fall back to the java natural order which may change from execution to execution.

      This property defaults to 32.

      Returns:
      the order in which this task will be fired.
      Default:
      (byte)0x20
    • lifecycle

      ModuleLifeCycle lifecycle
      Get the module lifecycle in which this task should be fired. Please note that tasks targeting the lifecycle ModuleLifeCycle.UNUSABLE will be registered but never fired.

      This property defaults to ModuleLifeCycle.STARTED

      Returns:
      the module lifecycle in which this task should be fired.
      Default:
      STARTED