Annotation Interface TaskHandler


@Retention(RUNTIME) @Target(METHOD) public @interface TaskHandler
Marks a method as a task handler, meaning it will be registered and called as a scheduled task in the PluginScheduler.
The method can have one Cancellable parameter to allow the task to cancel itself.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    long
    The initial delay before the first execution of the task.
    long
    The interval between each execution of the task.
    The time unit of the interval and initial delay.
  • Element Details

    • interval

      long interval
      The interval between each execution of the task. The task will be executed once if the interval is set to a value below -1.
      Default:
      -1L
    • delay

      long delay
      The initial delay before the first execution of the task. The task will be executed immediately if the delay is set to a value below -1.
      Default:
      -1L
    • unit

      The time unit of the interval and initial delay.
      Default:
      SECONDS