Is it possible to change the CronTrigger
state to WAITING
or to some other value which stops the job execution till next day? I can pause the trigger which will stop开发者_运维问答 job execution but then I have to manual resume this trigger.
Actually, I have a CronTrigger which executes job every day between say 8:00 AM - 12:00 PM, right now it's working fine but now I would like to add an aditional check that before executing every job it will check the total number of jobs executed and pause the execution till next day if the total executed jobs limit is reached.
You'll want to create a custom TriggerListener, which keeps track of the count, can veto job execution, and reschedules jobs for the next day (e.g. updates the triggers' startTime to "00:00:00" of the next day while leaving the cron expression to the same).
精彩评论