/** * <p> * Called when the <code>{@link Scheduler}</code> has decided to 'fire' the trigger (execute the associated <code>Job</code>), in order to give the * <code>Trigger</code> a chance to update itself for its next triggering (if any). * </p> * * @see #executionComplete(JobExecutionContext, JobExecutionException) */ @Override public void triggered(org.quartz.core.Calendar calendar) { previousFireTime = nextFireTime; nextFireTime = getFireTimeAfter(nextFireTime); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } }
/** * <p> * Called when the <code>{@link Scheduler}</code> has decided to 'fire' the trigger (execute the associated <code>Job</code>), in order to give the * <code>Trigger</code> a chance to update itself for its next triggering (if any). * </p> * * @see #executionComplete(JobExecutionContext, JobExecutionException) */ @Override public void triggered(org.quartz.core.Calendar calendar) { previousFireTime = nextFireTime; nextFireTime = getFireTimeAfter(nextFireTime); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } }
/** * Called when the <code>{@link Scheduler}</code> has decided to 'fire' the trigger (execute the * associated <code>Job</code>), in order to give the <code>Trigger</code> a chance to update * itself for its next triggering (if any). * * @see #executionComplete(JobExecutionContext, JobExecutionException) */ @Override public void triggered(org.quartz.core.Calendar calendar) { previousFireTime = nextFireTime; nextFireTime = getFireTimeAfter(nextFireTime); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } }
/** * <p> * Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in order to have the <code>Trigger</code> compute its * first fire time, based on any associated calendar. * </p> * <p> * After this method has been called, <code>getNextFireTime()</code> should return a valid answer. * </p> * * @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which is also the same value * <code>getNextFireTime()</code> will return (until after the first firing of the <code>Trigger</code>). </p> */ @Override public Date computeFirstFireTime(org.quartz.core.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } return nextFireTime; }
/** * Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in * order to have the <code>Trigger</code> compute its first fire time, based on any associated * calendar. * * <p>After this method has been called, <code>getNextFireTime()</code> should return a valid * answer. * * @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which * is also the same value <code>getNextFireTime()</code> will return (until after the first * firing of the <code>Trigger</code>). */ @Override public Date computeFirstFireTime(org.quartz.core.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } return nextFireTime; }
/** * <p> * Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in order to have the <code>Trigger</code> compute its * first fire time, based on any associated calendar. * </p> * <p> * After this method has been called, <code>getNextFireTime()</code> should return a valid answer. * </p> * * @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which is also the same value * <code>getNextFireTime()</code> will return (until after the first firing of the <code>Trigger</code>). * </p> */ @Override public Date computeFirstFireTime(org.quartz.core.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } return nextFireTime; }
/** * Updates the <code>CronTrigger</code>'s state based on the MISFIRE_INSTRUCTION_XXX that was * selected when the <code>CronTrigger</code> was created. * * <p>If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY, then the following * scheme will be used: <br> * * <ul> * <li>The instruction will be interpreted as <code>MISFIRE_INSTRUCTION_FIRE_ONCE_NOW</code> * </ul> */ @Override public void updateAfterMisfire(org.quartz.core.Calendar cal) { int instr = getMisfireInstruction(); if (instr == Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY) { return; } if (instr == MISFIRE_INSTRUCTION_SMART_POLICY) { instr = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW; } if (instr == MISFIRE_INSTRUCTION_DO_NOTHING) { Date newFireTime = getFireTimeAfter(new Date()); while (newFireTime != null && cal != null && !cal.isTimeIncluded(newFireTime.getTime())) { newFireTime = getFireTimeAfter(newFireTime); } setNextFireTime(newFireTime); } else if (instr == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) { setNextFireTime(new Date()); } }
Date newFireTime = getFireTimeAfter(new Date()); while (newFireTime != null && cal != null && !cal.isTimeIncluded(newFireTime.getTime())) { newFireTime = getFireTimeAfter(newFireTime);
Date newFireTime = getFireTimeAfter(new Date()); while (newFireTime != null && cal != null && !cal.isTimeIncluded(newFireTime.getTime())) { newFireTime = getFireTimeAfter(newFireTime);