Misfires
When a trigger misses its firing time due to reasons such as the Scheduler was paused or shut down, this is referred to as a misfire. Misfires are determined by the triggers misfire instruction. There are trigger misfires types available for all trigger types and those that are specific to "simple" and "cron" trigger types.
All Triggers - These misfire instructions are applicable to any trigger.
MISFIRE_INSTRUCTION_SMART_POLICY: This misfire instruction is the default for all triggers created. Essentially this instructs the trigger to use a default policy dependent on the type of trigger that is created. For a "simple" trigger the rule is as follows:
- If the Repeat Count is 0 then the instruction will be interpreted as MISFIRE_INSTRUCTION_FIRE_NOW.
- If the Repeat Count is REPEAT_INDEFINITELY, then the instruction will be interpreted as MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT. WARNING: using MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT with a trigger that has a non-null end-time may cause the trigger to never fire again if the end-time arrived during the misfire time span.
- If the Repeat Count is 0, then the instruction will be interpreted as MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT.
INSTRUCTION_RE_EXECUTE_JOB: Instructs the Scheduler that the Trigger wants the JobDetail to re-execute immediately.
INSTRUCTION_SET_TRIGGER_COMPLETE: Instructs the Scheduler that the Trigger should be put in the COMPLETE state. It essentially skips the misfired trigger.
INSTRUCTION_DELETE_TRIGGER: Instructs Scheduler that the Trigger wants itself deleted.
INSTRUCTION_SET_TRIGGER_ERROR: Instructs the Scheduler that Trigger should be put in the error state.
Simple Triggers - These misfire instructions are applicable to only "simple" triggers.
MISFIRE_INSTRUCTION_FIRE_NOW: Instructs the Scheduler that upon a misfire situation, the trigger wants to be fired now by the Scheduler. NOTE This instruction should typically only be used for 'one-shot' (non-repeating) Triggers. If it is used on a trigger with a repeat count > 0 then it is equivalent to the instruction MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT.
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT: Instructs the Scheduler that upon a misfire situation, the trigger wants to be re-scheduled to with the repeat count left as-is. NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with. NOTE: This instruction could cause the Trigger to go to the 'COMPLETE' state after firing 'now', if all the repeat-fire-times where missed.
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT: Instructs the Scheduler that upon a misfire situation, the trigger wants to be re-scheduled to 'now' with the repeat count set to what it would be, if it had not missed any firings. NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with (this is only an issue if you for some reason wanted to be able to tell what the original values were at some later time). NOTE: This instruction could cause the trigger to go to the 'COMPLETE' state after firing 'now', if all the repeat-fire-times where missed.
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT: Instructs the Scheduler that upon a misfire situation, the trigger wants to be re-scheduled to the next scheduled time after 'now' and with the repeat count set to what it would be, if it had not missed any firings. NOTE/WARNING: This instruction could cause the trigger to go directly to the 'COMPLETE' state if all fire-times where missed.
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT: Instructs the Scheduler that upon a misfire situation, the trigger wants to be re-scheduled to the next scheduled time after 'now' and with the repeat count left unchanged. NOTE: Use of this instruction causes the trigger to 'forget' the repeat-count that it was originally setup with. NOTE/WARNING: This instruction could cause the trigger to go directly to the 'COMPLETE' state if all fire-times where missed.
CRON Triggers - these apply to the "cron" type triggers
MISFIRE_INSTRUCTION_FIRE_ONCE_NOW: Instructs the Scheduler that upon a misfire situation, trigger wants to be fired now by the Scheduler.
MISFIRE_INSTRUCTION_DO_NOTHING: Instructs the Scheduler that upon a misfire, the trigger wants to have it's next-fire-time updated to the next time in the schedule after the current time (taking into account any associated <code>{@link Calendar}</code>, but it does not want to be fired now.