Class Schedule.Literal

java.lang.Object
jakarta.enterprise.util.AnnotationLiteral<Schedule>
jakarta.enterprise.concurrent.Schedule.Literal
All Implemented Interfaces:
Annotation
Enclosing class:
Schedule

public static final class Schedule.Literal extends jakarta.enterprise.util.AnnotationLiteral<Schedule> implements Schedule
Enables instances of the Schedule annotation to be created at run time.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class jakarta.enterprise.concurrent.Schedule

    Schedule.Literal
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Schedule.Literal
    Instance of the Schedule annotation with all values set to their defaults.
  • Method Summary

    Modifier and Type
    Method
    Description
    Cron expression following the rules of CronTrigger.
    int[]
    Days of the month on which the method aims to run.
    Days of the week on which the method aims to run.
    int[]
    Hours of the day at which the method aims to run.
    int[]
    Minutes at which the method aims to run.
    Months in which the method aims to run.
    of(String cron, Month[] months, int[] daysOfMonth, DayOfWeek[] daysOfWeek, int[] hours, int[] minutes, int[] seconds, long skipIfLateBy, String zone)
    Construct a new instance of the Schedule annotation.
    int[]
    Seconds at which the method aims to run.
    long
    Seconds after which an execution that is late to start should be skipped rather than starting late.
    Time zone id, such as America/Chicago, which identifies the time zone of the schedule.

    Methods inherited from class jakarta.enterprise.util.AnnotationLiteral

    annotationType, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • INSTANCE

      public static final Schedule.Literal INSTANCE
      Instance of the Schedule annotation with all values set to their defaults.
  • Method Details

    • of

      public static Schedule.Literal of(String cron, Month[] months, int[] daysOfMonth, DayOfWeek[] daysOfWeek, int[] hours, int[] minutes, int[] seconds, long skipIfLateBy, String zone)
      Construct a new instance of the Schedule annotation.
      Parameters:
      cron - Cron expression following the rules of CronTrigger. Empty string to disregard.
      months - Months in which the method aims to run. Empty to disregard.
      daysOfMonth - Days of the month (1 to 31) on which the method aims to run. Empty to disregard.
      daysOfWeek - Days of the week on which the method aims to run. Empty to disregard.
      hours - Hours of the day (0 to 23) at which the method aims to run. Empty to disregard.
      minutes - Minutes (0 to 59) at which the method aims to run. Empty to disregard.
      seconds - Seconds (0 to 59) at which the method aims to run. Must not be empty.
      skipIfLateBy - Seconds after which an execution that is late to start should be skipped instead of starting late.
      zone - Time zone id, such as America/Chicago, of the schedule. Empty string indicates the default time zone.
      Returns:
      a new instance of the Schedule annotation.
    • cron

      public String cron()

      Cron expression following the rules of CronTrigger.

      Returns:
      cron expression indicating when to run the method.
    • months

      public Month[] months()

      Months in which the method aims to run.

      Returns:
      list of months in which the method aims to run; An empty list disregards the month.
    • daysOfMonth

      public int[] daysOfMonth()

      Days of the month on which the method aims to run. Values can range from 1 to 31.

      Returns:
      list of days of the month on which the method aims to run; An empty list disregards the day of the month.
    • daysOfWeek

      public DayOfWeek[] daysOfWeek()

      Days of the week on which the method aims to run.

      Returns:
      list of days of the week on which the method aims to run; An empty list disregards the day of the week.
    • hours

      public int[] hours()

      Hours of the day at which the method aims to run. Values can range from 0 to 23.

      Returns:
      list of hours at which the method aims to run; An empty list disregards the hour.
    • minutes

      public int[] minutes()

      Minutes at which the method aims to run. Values can range from 0 to 59.

      Returns:
      list of minutes at which the method aims to run; An empty list disregards the minutes.
    • seconds

      public int[] seconds()

      Seconds at which the method aims to run. Values can range from 0 to 59.

      Returns:
      list of seconds at which the method aims to run.
    • skipIfLateBy

      public long skipIfLateBy()

      Seconds after which an execution that is late to start should be skipped rather than starting late. Values must be greater than 0.

      Returns:
      the threshold for skipping executions that are late to start.
    • zone

      public String zone()

      Time zone id, such as America/Chicago, which identifies the time zone of the schedule.

      Returns:
      the time zone id. Empty string indicates to use the default time zone.