本文整理汇总了C#中IOperableTrigger.Triggered方法的典型用法代码示例。如果您正苦于以下问题:C# IOperableTrigger.Triggered方法的具体用法?C# IOperableTrigger.Triggered怎么用?C# IOperableTrigger.Triggered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOperableTrigger
的用法示例。
在下文中一共展示了IOperableTrigger.Triggered方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TriggerFired
protected virtual TriggerFiredBundle TriggerFired(ConnectionAndTransactionHolder conn, IOperableTrigger trigger)
{
IJobDetail job;
ICalendar cal = null;
// Make sure trigger wasn't deleted, paused, or completed...
try
{
// if trigger was deleted, state will be StateDeleted
string state = Delegate.SelectTriggerState(conn, trigger.Key);
if (!state.Equals(StateAcquired))
{
return null;
}
}
catch (Exception e)
{
throw new JobPersistenceException("Couldn't select trigger state: " + e.Message, e);
}
try
{
job = RetrieveJob(conn, trigger.JobKey);
if (job == null)
{
return null;
}
}
catch (JobPersistenceException jpe)
{
try
{
Log.Error("Error retrieving job, setting trigger state to ERROR.", jpe);
Delegate.UpdateTriggerState(conn, trigger.Key, StateError);
}
catch (Exception sqle)
{
Log.Error("Unable to set trigger state to ERROR.", sqle);
}
throw;
}
if (trigger.CalendarName != null)
{
cal = RetrieveCalendar(conn, trigger.CalendarName);
if (cal == null)
{
return null;
}
}
try
{
Delegate.UpdateFiredTrigger(conn, trigger, StateExecuting, job);
}
catch (Exception e)
{
throw new JobPersistenceException("Couldn't insert fired trigger: " + e.Message, e);
}
DateTimeOffset? prevFireTime = trigger.GetPreviousFireTimeUtc();
// call triggered - to update the trigger's next-fire-time state...
trigger.Triggered(cal);
string state2 = StateWaiting;
bool force = true;
if (job.ConcurrentExecutionDisallowed)
{
state2 = StateBlocked;
force = false;
try
{
Delegate.UpdateTriggerStatesForJobFromOtherState(conn, job.Key, StateBlocked, StateWaiting);
Delegate.UpdateTriggerStatesForJobFromOtherState(conn, job.Key, StateBlocked, StateAcquired);
Delegate.UpdateTriggerStatesForJobFromOtherState(conn, job.Key, StatePausedBlocked, StatePaused);
}
catch (Exception e)
{
throw new JobPersistenceException("Couldn't update states of blocked triggers: " + e.Message, e);
}
}
if (!trigger.GetNextFireTimeUtc().HasValue)
{
state2 = StateComplete;
force = true;
}
StoreTrigger(conn, trigger, job, true, state2, force, false);
job.JobDataMap.ClearDirtyFlag();
return new TriggerFiredBundle(
job,
trigger,
cal,
trigger.Key.Group.Equals(SchedulerConstants.DefaultRecoveryGroup),
SystemTime.UtcNow(),
//.........这里部分代码省略.........