A concrete {@link Trigger}
that is used to fire a {@link org.quartz.JobDetail}
based upon repeating calendar time intervals.
The trigger will fire every N (see {@link #setRepeatInterval(int)} ) units of calendar time(see {@link #setRepeatIntervalUnit(org.quartz.DateBuilder.IntervalUnit)}) as specified in the trigger's definition. This trigger can achieve schedules that are not possible with {@link SimpleTrigger} (e.g because months are not a fixed number of seconds) or {@link CronTrigger} (e.g. because"every 5 months" is not an even divisor of 12).
If you use an interval unit of MONTH
then care should be taken when setting a startTime
value that is on a day near the end of the month. For example, if you choose a start time that occurs on January 31st, and have a trigger with unit MONTH
and interval 1
, then the next fire time will be February 28th, and the next time after that will be March 28th - and essentially each subsequent firing will occur on the 28th of the month, even if a 31st day exists. If you want a trigger that always fires on the last day of the month - regardless of the number of days in the month, you should use CronTrigger
.
|
|
|
|