Quartz.Impl.Triggers.DailyTimeIntervalTriggerImpl.UpdateAfterMisfire C# (CSharp) Method

UpdateAfterMisfire() public method

Updates the ICalendarIntervalTrigger's state based on the MisfireInstruction.XXX that was selected when the IDailyTimeIntervalTrigger was created.
If the misfire instruction is set to MisfireInstruction.SmartPolicy, then the following scheme will be used:
  • The instruction will be interpreted as MisfireInstruction.DailyTimeIntervalTrigger.FireOnceNow
public UpdateAfterMisfire ( ICalendar cal ) : void
cal ICalendar
return void
        public override void UpdateAfterMisfire(ICalendar cal)
        {
            int instr = MisfireInstruction;

            if (instr == Quartz.MisfireInstruction.IgnoreMisfirePolicy)
            {
                return;
            }

            if (instr == Quartz.MisfireInstruction.SmartPolicy)
            {
                instr = Quartz.MisfireInstruction.DailyTimeIntervalTrigger.FireOnceNow;
            }

            if (instr == Quartz.MisfireInstruction.DailyTimeIntervalTrigger.DoNothing)
            {
                DateTimeOffset? newFireTime = GetFireTimeAfter(SystemTime.UtcNow());
                while (newFireTime != null && cal != null && !cal.IsTimeIncluded(newFireTime.Value))
                {
                    newFireTime = GetFireTimeAfter(newFireTime);
                }
                SetNextFireTimeUtc(newFireTime);
            }
            else if (instr == Quartz.MisfireInstruction.CalendarIntervalTrigger.FireOnceNow)
            {
                // fire once now...
                SetNextFireTimeUtc(SystemTime.UtcNow());
                // the new fire time afterward will magically preserve the original
                // time of day for firing for day/week/month interval triggers,
                // because of the way getFireTimeAfter() works - in its always restarting
                // computation from the start time.
            }
        }