Define a
Quartz Trigger
. Using one of three expressions:
- interval: like
5s;delay=60s;repeat=*
,delay
andrepeat
are optional - cron: like
0/3 * * * * ?
- property name: a property defined in
.conf
file which has one of two previous formats
Run every 5 minutes, start immediately and repeat for ever:
@Scheduled("5m") @Scheduled("5m; delay=0") @Scheduled("5m; delay=0; repeat=*")Previous, expressions are identical.
Run every 1 hour with an initial delay of 15 minutes for 10 times
@Scheduled("1h; delay=15m; repeat=10")
Fire at 12pm (noon) every day
0 0 12 * * ?
Fire at 10:15am every day
0 15 10 ? * *
- Since:
- 0.5.0
- Author:
- edgar
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionSometimes, when you have many Triggers (or few worker threads in your Quartz thread pool), Quartz may not have enough resources to immediately fire all of the Triggers that are scheduled to fire at the same time.int
A misfire occurs if a persistent trigger "misses" its firing time because of the scheduler being shutdown, or because there are no available threads in Quartz’s thread pool for executing the job.int
Quartz Calendar objects (not java.util.Calendar objects) can be associated with triggers at the time the trigger is defined and stored in the scheduler.
-
Element Details
-
value
String valueExpression can be one of these three options:- Interval: 10s, 10secs, 10minutes, 1h, etc...
- Cron expression: 0/3 * * * * ?
- Reference to a property, where the property value is one of the two previous options
- Returns:
- an expression to create an scheduler.
- See Also:
-
Config.getDuration(String, java.util.concurrent.TimeUnit)
-
-
-
calendar
String calendarSometimes, when you have many Triggers (or few worker threads in your Quartz thread pool), Quartz may not have enough resources to immediately fire all of the Triggers that are scheduled to fire at the same time. In this case, you may want to control which of your Triggers get first crack at the available Quartz worker threads. For this purpose, you can set the priority property on a Trigger.- Returns:
- Quartz calendar.
- Default:
- ""
-
priority
int priorityQuartz Calendar objects (not java.util.Calendar objects) can be associated with triggers at the time the trigger is defined and stored in the scheduler. Calendars are useful for excluding blocks of time from the the trigger’s firing schedule.- Returns:
- Priority default 5.
- Default:
- 5
-
misfire
int misfireA misfire occurs if a persistent trigger "misses" its firing time because of the scheduler being shutdown, or because there are no available threads in Quartz’s thread pool for executing the job.- Returns:
- Misfire instruction.
- Default:
- 0
-