Top Description Methods
jakarta.enterprise.concurrent

public @Interface Schedule

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:ANNOTATION_TYPE
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, java.time.DayOfWeek, .Month

Defines schedules for scheduled asynchronous methods.

For the scheduled asychronous method to aim to run at a given day and time, all of the criteria specified by the Schedule must match or be disregarded according to the rules of each field.

Since
3.1

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

cron expression indicating when to run the asynchronous method.
cron
()

Cron expression following the rules of CronTrigger.

public int[]

Returns:

list of days of the month on which the asynchronous method aims to run; An empty list disregards the day of the month.
daysOfMonth
()

Days of the month on which the asynchronous method aims to run.

public DayOfWeek[]

Returns:

list of days of the week on which the asynchronous method aims to run; An empty list disregards the day of the week.
daysOfWeek
()

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

public int[]

Returns:

list of hours at which the asynchronous method aims to run; An empty list disregards the hour.
hours
()

Hours of the day at which the asynchronous method aims to run.

public int[]

Returns:

list of minutes at which the asynchronous method aims to run; An empty list disregards the minutes.
minutes
()

Minutes at which the asynchronous method aims to run.

public Month[]

Returns:

list of months in which the asynchronous method aims to run; An empty list disregards the month.
months
()

Months in which the asynchronous method aims to run.

public int[]

Returns:

list of seconds at which the asynchronous method aims to run.
seconds
()

Seconds at which the asynchronous method aims to run.

public long

Returns:

the threshold for skipping executions that are late to start.
skipIfLateBy
()

Seconds after which an execution that is late to start should be skipped rather than starting it late.

public String
zone()

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

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

cronback to summary
public String cron()

Cron expression following the rules of CronTrigger.

When a non-empty value is specified, it overrides all values that are specified for months, daysOfMonth, daysOfWeek, hours, minutes, and seconds.

The default value is the empty string, indicating that no cron expression is to be used.

Returns:String

cron expression indicating when to run the asynchronous method.

daysOfMonthback to summary
public int[] daysOfMonth()

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

The default value is an empty list, which means that the day of the month is not included in the criteria for deciding when to run the asynchronous method.

Returns:int[]

list of days of the month on which the asynchronous method aims to run; An empty list disregards the day of the month.

daysOfWeekback to summary
public DayOfWeek[] daysOfWeek()

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

The default value is an empty list, which means that the day of the week is not included in the criteria for deciding when to run the asynchronous method.

Returns:DayOfWeek[]

list of days of the week on which the asynchronous method aims to run; An empty list disregards the day of the week.

hoursback to summary
public int[] hours()

Hours of the day at which the asynchronous method aims to run.

Values can range from 0 to 23. A value of empty list indicates that the hour is not included in the criteria for deciding when to run the asynchronous method.

The default value is 0 (midnight).

Returns:int[]

list of hours at which the asynchronous method aims to run; An empty list disregards the hour.

minutesback to summary
public int[] minutes()

Minutes at which the asynchronous method aims to run.

Values can range from 0 to 59. A value of empty list indicates that the minute is not included in the criteria for deciding when to run the asynchronous method.

The default value is 0 (at the start of the hour).

Returns:int[]

list of minutes at which the asynchronous method aims to run; An empty list disregards the minutes.

monthsback to summary
public Month[] months()

Months in which the asynchronous method aims to run.

The default value is an empty list, which means that the month is not included in the criteria for deciding when to run the asynchronous method.

Returns:Month[]

list of months in which the asynchronous method aims to run; An empty list disregards the month.

secondsback to summary
public int[] seconds()

Seconds at which the asynchronous method aims to run.

Values can range from 0 to 59. A value of empty list causes the asynchronous method to raise IllegalArgumentException.

The default value is 0 (at the start of the minute).

Returns:int[]

list of seconds at which the asynchronous method aims to run.

skipIfLateByback to summary
public long skipIfLateBy()

Seconds 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:long

the threshold for skipping executions that are late to start.

zoneback to summary
public String zone()

Time 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 the default time zone for the system.