Annotation Interface Schedule


@Target(METHOD) @Retention(RUNTIME) public @interface Schedule
调度任务注解 - 标记方法为定时执行的任务
Since:
1.0.0
Version:
1.0.0
Author:
Berry_so
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    是否允许并发执行(重复任务)
    boolean
    是否异步执行
    boolean
    是否自动注册(插件启用时)
    任务注释
    long
    延迟执行时间 当type = BUKKIT时,单位为tick 当type = MAGSTAR时,配合timeUnit使用
    boolean
    是否立即执行
    long
    重复执行时间(0表示不重复) 当type = BUKKIT时,单位为tick 当type = MAGSTAR时,配合timeUnit使用
    int
    任务优先级(数值越小优先级越高)
    long
    任务超时时间(毫秒,0表示无超时)
    时间单位(仅对MagstarScheduler有效)
    任务类型 - 决定使用Bukkit调度器还是MagstarScheduler
  • Element Details

    • now

      boolean now
      是否立即执行
      Returns:
      true表示立即执行,false表示按延迟执行
      Default:
      false
    • async

      boolean async
      是否异步执行
      Returns:
      true表示异步执行,false表示同步执行
      Default:
      false
    • type

      任务类型 - 决定使用Bukkit调度器还是MagstarScheduler
      Returns:
      调度类型
      Default:
      AUTO
    • delay

      long delay
      延迟执行时间 当type = BUKKIT时,单位为tick 当type = MAGSTAR时,配合timeUnit使用
      Returns:
      延迟时间
      Default:
      0L
    • period

      long period
      重复执行时间(0表示不重复) 当type = BUKKIT时,单位为tick 当type = MAGSTAR时,配合timeUnit使用
      Returns:
      重复周期
      Default:
      0L
    • timeUnit

      TimeUnit timeUnit
      时间单位(仅对MagstarScheduler有效)
      Returns:
      时间单位
      Default:
      MILLISECONDS
    • comment

      String comment
      任务注释
      Returns:
      任务描述
      Default:
      ""
    • autoRegister

      boolean autoRegister
      是否自动注册(插件启用时)
      Returns:
      true表示自动注册,false表示手动注册
      Default:
      true
    • priority

      int priority
      任务优先级(数值越小优先级越高)
      Returns:
      优先级值
      Default:
      100
    • allowConcurrent

      boolean allowConcurrent
      是否允许并发执行(重复任务)
      Returns:
      true表示允许并发,false表示禁止并发
      Default:
      true
    • timeout

      long timeout
      任务超时时间(毫秒,0表示无超时)
      Returns:
      超时时间
      Default:
      0L