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
FieldsModifier and TypeFieldDescriptionstatic final Schedule.LiteralInstance of theScheduleannotation with all values set to their defaults. -
Method Summary
Modifier and TypeMethodDescriptioncron()Cron expression following the rules ofCronTrigger.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()Hours of the day at which the method aims to run.int[]minutes()Minutes at which the method aims to run.Month[]months()Months in which the method aims to run.static Schedule.Literalof(String cron, Month[] months, int[] daysOfMonth, DayOfWeek[] daysOfWeek, int[] hours, int[] minutes, int[] seconds, long skipIfLateBy, String zone) Construct a new instance of theScheduleannotation.int[]seconds()Seconds at which the method aims to run.longSeconds after which an execution that is late to start should be skipped rather than starting late.zone()Time zone id, such asAmerica/Chicago, which identifies the time zone of the schedule.Methods inherited from class jakarta.enterprise.util.AnnotationLiteral
annotationType, equals, hashCode, toString
-
Field Details
-
INSTANCE
Instance of theScheduleannotation 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 theScheduleannotation.- Parameters:
cron- Cron expression following the rules ofCronTrigger. 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 asAmerica/Chicago, of the schedule. Empty string indicates thedefault time zone.- Returns:
- a new instance of the
Scheduleannotation.
-
cron
Cron expression following the rules of
CronTrigger.- Returns:
- cron expression indicating when to run the method.
-
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
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
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.
-