Save This Page
Home » quartz-1.6.0 » org » quartz » examples » [javadoc | source]
org.quartz.examples
public class: InterruptableJobTest [javadoc | source]
java.lang.Object
   org.quartz.examples.InterruptableJobTest
Demonstrates the behavior of StatefulJobs, as well as how misfire instructions affect the firings of triggers of StatefulJob s - when the jobs take longer to execute that the frequency of the trigger's repitition.

While the example is running, you should note that there are two triggers with identical schedules, firing identical jobs. The triggers "want" to fire every 3 seconds, but the jobs take 10 seconds to execute. Therefore, by the time the jobs complete their execution, the triggers have already "misfired" (unless the scheduler's "misfire threshold" has been set to more than 7 seconds). You should see that one of the jobs has its misfire instruction set to SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT- which causes it to fire immediately, when the misfire is detected. The other trigger uses the default "smart policy" misfire instruction, which causes the trigger to advance to its next fire time (skipping those that it has missed) - so that it does not refire immediately, but rather at the next scheduled time.

Method from org.quartz.examples.InterruptableJobTest Summary:
main,   schedTest
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.quartz.examples.InterruptableJobTest Detail:
 public static  void main(String[] args) throws Exception 
 public static  void schedTest(SchedulerFactory sf) throws Exception