@Target(value={METHOD,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Documented public @interface Scheduled
Define a Quartz Trigger
. Using one of three expressions:
5s;delay=60s;repeat=*
, delay
and repeat
are optional
0/3 * * * * ?
.conf
file which has one of two previous
formatsRun 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 ? * *
Modifier and Type | Required Element and Description |
---|---|
String |
value
Expression 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
|
Modifier and Type | Optional Element and Description |
---|---|
String |
calendar
Sometimes, 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 |
misfire
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 |
priority
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.
|
public abstract String value
Config.getDuration(String, java.util.concurrent.TimeUnit)
public abstract String calendar
public abstract int priority
Copyright © 2020. All rights reserved.