Package jakarta.enterprise.concurrent
Annotation Interface Schedule
Defines schedules for
scheduled asynchronous methods
.
- Since:
- 3.1
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionCron expression following the rules ofCronTrigger
.int[]
Days of the month on which the task aims to runs.Days of the week on which the task aims to runs.int[]
Hours of the day at which the task aims to runs.int[]
Minutes at which the task aims to runs.Month[]
Months in which the task aims to runs.int[]
Seconds at which the task aims to runs.long
Seconds after which an execution that is late to start should be skipped rather than starting it late.Time zone id, such as America/Chicago or America/Los_Angeles, which identifies the time zone of the schedule.
-
Element Details
-
cron
String cronCron expression following the rules ofCronTrigger
. When a non-empty value is specified, it overrides all values that are specified for month, dayOfMonth, dayOfWeek, hours, minutes, and seconds. The default value is the empty-string, indicating that no cron expression is to be used.- Returns:
- cron expression indicating when to run the task.
- Default:
""
-
months
Month[] monthsMonths in which the task aims to runs. The default value is every month.- Returns:
- list of months in which the task aims to run.
- Default:
{JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER}
-
daysOfMonth
int[] daysOfMonthDays of the month on which the task aims to runs. Values can range from 1 to 31. The default value is every day of the month.- Returns:
- list of days of the month on which the task aims to run.
- Default:
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}
-
daysOfWeek
DayOfWeek[] daysOfWeekDays of the week on which the task aims to runs. The default value is every day of the week.- Returns:
- list of days of the month on which the task aims to run.
- Default:
{SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY}
-
hours
int[] hoursHours of the day at which the task aims to runs. Values can range from 0 to 23. The default value is 0 (midnight).- Returns:
- list of hours at which the task aims to run.
- Default:
{0}
-
minutes
int[] minutesMinutes at which the task aims to runs. Values can range from 0 to 59. The default value is 0 (at the start of the hour).- Returns:
- list of minutes at which the task aims to run.
- Default:
{0}
-
seconds
int[] secondsSeconds at which the task aims to runs. Values can range from 0 to 59. The default value is 0 (at the start of the minute).- Returns:
- list of seconds at which the task aims to run.
- Default:
{0}
-
skipIfLateBy
long skipIfLateBySeconds after which an execution that is late to start should be skipped rather than starting it late. Values must be greater than 0. The default value is 600 seconds (10 minutes). This differs from executions that are missed due to overlap, which are always skipped.- Returns:
- the threshold for skipping executions that are late to start.
- Default:
600L
-
zone
String zoneTime zone id, such as America/Chicago or America/Los_Angeles, which identifies the time zone of the schedule. The default value of empty string indicates to use thedefault time zone
for the system.- Default:
""
-