Annotation Interface Scheduled


@Documented @Target(METHOD) @Retention(RUNTIME) public @interface Scheduled
Indicates that the method should be periodically called. The annotated method must expect no arguments.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A CRON-like expression containing the second, minute, hour, day of month, month, and day of week.
    A time zone for which the CRON expression will be resolved.
    int
    The time in milliseconds between the end of the last execution and the next execution.
    int
    The time in milliseconds between each execution.
    int
    The time in milliseconds to wait before the first execution of fixedDelay() and fixedRate().
  • Element Details

    • fixedDelay

      int fixedDelay
      The time in milliseconds between the end of the last execution and the next execution.
      Returns:
      The time in milliseconds
      Default:
      0
    • fixedRate

      int fixedRate
      The time in milliseconds between each execution.
      Returns:
      The time in milliseconds
      Default:
      0
    • initialDelay

      int initialDelay
      The time in milliseconds to wait before the first execution of fixedDelay() and fixedRate(). If not specified, the fixedRate() value will be used.
      Returns:
      The initial delay
      Default:
      0
    • cron

      String cron
      A CRON-like expression containing the second, minute, hour, day of month, month, and day of week.
      Returns:
      The CRON expression
      Default:
      ""
    • cronZone

      String cronZone
      A time zone for which the CRON expression will be resolved. If not specified, the server's local time zone will be used.
      Returns:
      A zone id accepted by TimeZone.getTimeZone(String)
      Default:
      "UTC"