I was wondering how I might take a CronTrigger and add an extra one-off firing such that I can iterate over the firing times as I might with the getFileTimeAfter(Date) method
Say if I had a CronTrigger expressed by: “0 0 12 * * ?”
How might I add one additional firing as might be expressed by a SimpleTrigger with no repeat?
This isn’t possible with
CronTriggeritself. You can, however, associate as many different Triggers with a givenJobDetailas you like.You could simulate what you’re trying to achieve by registering your
CronTriggerplus aSimpleTrigger, callgetFireTimeAfteron each trigger, and take the earlier value.Annoyingly,
getFireTimeAfteris present on bothCronTriggerandSimpleTrigger, but isn’t in theTriggerinterface. That’s the least of Quartz’s API sins, mind you.