本文整理匯總了C#中Quartz.Core.QuartzScheduler.NotifySchedulerListenersError方法的典型用法代碼示例。如果您正苦於以下問題:C# QuartzScheduler.NotifySchedulerListenersError方法的具體用法?C# QuartzScheduler.NotifySchedulerListenersError怎麽用?C# QuartzScheduler.NotifySchedulerListenersError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Quartz.Core.QuartzScheduler
的用法示例。
在下文中一共展示了QuartzScheduler.NotifySchedulerListenersError方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Initialize
/// <summary>
/// Initializes the job execution context with given scheduler and bundle.
/// </summary>
/// <param name="sched">The scheduler.</param>
public virtual void Initialize(QuartzScheduler sched)
{
qs = sched;
IJob job;
IJobDetail jobDetail = firedTriggerBundle.JobDetail;
try
{
job = sched.JobFactory.NewJob(firedTriggerBundle, scheduler);
}
catch (SchedulerException se)
{
sched.NotifySchedulerListenersError(string.Format(CultureInfo.InvariantCulture, "An error occured instantiating job to be executed. job= '{0}'", jobDetail.Key), se);
throw;
}
catch (Exception e)
{
SchedulerException se = new SchedulerException(string.Format(CultureInfo.InvariantCulture, "Problem instantiating type '{0}'", jobDetail.JobType.FullName), e);
sched.NotifySchedulerListenersError(string.Format(CultureInfo.InvariantCulture, "An error occured instantiating job to be executed. job= '{0}'", jobDetail.Key), se);
throw se;
}
jec = new JobExecutionContextImpl(scheduler, firedTriggerBundle, job);
}
示例2: Initialize
/// <summary>
/// Initializes the job execution context with given scheduler and bundle.
/// </summary>
/// <param name="sched">The scheduler.</param>
public virtual async Task Initialize(QuartzScheduler sched)
{
qs = sched;
IJob job;
IJobDetail jobDetail = firedTriggerBundle.JobDetail;
try
{
job = sched.JobFactory.NewJob(firedTriggerBundle, scheduler);
}
catch (SchedulerException se)
{
await sched.NotifySchedulerListenersError($"An error occurred instantiating job to be executed. job= '{jobDetail.Key}'", se).ConfigureAwait(false);
throw;
}
catch (Exception e)
{
SchedulerException se = new SchedulerException($"Problem instantiating type '{jobDetail.JobType.FullName}'", e);
await sched.NotifySchedulerListenersError($"An error occurred instantiating job to be executed. job= '{jobDetail.Key}'", se).ConfigureAwait(false);
throw se;
}
jec = new JobExecutionContextImpl(scheduler, firedTriggerBundle, job);
}