I'm new to Quartz in java and I have a question regarding misfiring. I have set up a SimpleTrigger which fires every 5 seconds. Sometimes the associated job takes over 5 seconds. I'd like to skip the job when that happens (the set interval has been reached by the Trigger). Going through the API I d开发者_StackOverflow中文版ont find a misfiring policy that would do that. Any toughts? Thank you for the help
There are a couple of different misfire policies that could work for you. Look at the javadocs here: http://www.quartz-scheduler.org/docs/api/1.8.0/org/quartz/SimpleTrigger.html paying attention to the static final constants that start with MISFIRE_INSTRUCTION_RESCHEDULE_*. There are a number of different behaviors in regards to the repeat count, but I think they'll accomplish what you're trying to do.
精彩评论