当前位置: 首页>>代码示例>>C#>>正文


C# Core.SchedulingContext类代码示例

本文整理汇总了C#中Quartz.Core.SchedulingContext的典型用法代码示例。如果您正苦于以下问题:C# SchedulingContext类的具体用法?C# SchedulingContext怎么用?C# SchedulingContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SchedulingContext类属于Quartz.Core命名空间,在下文中一共展示了SchedulingContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JobRunShell

		/// <summary>
		/// Create a JobRunShell instance with the given settings.
		/// </summary>
		/// <param name="jobRunShellFactory">A handle to the <see cref="IJobRunShellFactory" /> that produced
		/// this <see cref="JobRunShell" />.</param>
		/// <param name="scheduler">The <see cref="IScheduler" /> instance that should be made
		/// available within the <see cref="JobExecutionContext" />.</param>
		/// <param name="schdCtxt">the <see cref="SchedulingContext" /> that should be used by the
		/// <see cref="JobRunShell" /> when making updates to the <see cref="IJobStore" />.</param>
		public JobRunShell(IJobRunShellFactory jobRunShellFactory, IScheduler scheduler, SchedulingContext schdCtxt)
		{
			this.jobRunShellFactory = jobRunShellFactory;
			this.scheduler = scheduler;
			this.schdCtxt = schdCtxt;
            log = LogManager.GetLogger(GetType());
		}
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:16,代码来源:JobRunShell.cs

示例2: StoreJobAndTrigger

 /// <summary>
 /// Store the given <see cref="JobDetail" /> and <see cref="Trigger" />.
 /// </summary>
 /// <param name="ctxt">SchedulingContext</param>
 /// <param name="newJob">Job to be stored.</param>
 /// <param name="newTrigger">Trigger to be stored.</param>
 public void StoreJobAndTrigger(SchedulingContext ctxt, JobDetail newJob, Trigger newTrigger)
 {
     ExecuteInLock((LockOnInsert) ? LockTriggerAccess : null,
                   new StoreJobAndTriggerCallback(this, newJob, newTrigger, ctxt));
 }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:11,代码来源:JobStoreSupport.cs

示例3: PauseTriggerGroup

        /// <summary>
        /// Pause all of the <see cref="Trigger" />s in the given group.
        /// </summary>
        public virtual void PauseTriggerGroup(SchedulingContext ctxt, string groupName)
        {
            ValidateState();

            if (groupName == null)
            {
                groupName = SchedulerConstants.DefaultGroup;
            }

            resources.JobStore.PauseTriggerGroup(ctxt, groupName);
            NotifySchedulerThread(null);
            NotifySchedulerListenersPausedTrigger(null, groupName);
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:16,代码来源:QuartzScheduler.cs

示例4: RescheduleJob

        /// <summary>
        /// Remove (delete) the <see cref="Trigger" /> with the
        /// given name, and store the new given one - which must be associated
        /// with the same job.
        /// </summary>
        /// <param name="ctxt">The scheduling context.</param>
        /// <param name="triggerName">The name of the <see cref="Trigger" /> to be removed.</param>
        /// <param name="groupName">The group name of the <see cref="Trigger" /> to be removed.</param>
        /// <param name="newTrigger">The new <see cref="Trigger" /> to be stored.</param>
        /// <returns>
        /// 	<see langword="null" /> if a <see cref="Trigger" /> with the given
        /// name and group was not found and removed from the store, otherwise
        /// the first fire time of the newly scheduled trigger.
        /// </returns>
        public virtual NullableDateTime RescheduleJob(SchedulingContext ctxt, string triggerName, string groupName, Trigger newTrigger)
        {
            ValidateState();

            if (groupName == null)
            {
                groupName = SchedulerConstants.DefaultGroup;
            }

            newTrigger.Validate();

            ICalendar cal = null;
            if (newTrigger.CalendarName != null)
            {
                cal = resources.JobStore.RetrieveCalendar(ctxt, newTrigger.CalendarName);
            }

            NullableDateTime ft = newTrigger.ComputeFirstFireTimeUtc(cal);

            if (!ft.HasValue)
            {
                throw new SchedulerException("Based on configured schedule, the given trigger will never fire.",
                                             SchedulerException.ErrorClientError);
            }

            if (resources.JobStore.ReplaceTrigger(ctxt, triggerName, groupName, newTrigger))
            {
                NotifySchedulerThread(newTrigger.GetNextFireTimeUtc());
                NotifySchedulerListenersUnscheduled(triggerName, groupName);
                NotifySchedulerListenersScheduled(newTrigger);
            }
            else
            {
                return null;
            }

            return ft;
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:52,代码来源:QuartzScheduler.cs

示例5: DeleteJob

        /// <summary>
        /// Delete the identified <see cref="IJob" /> from the Scheduler - and any
        /// associated <see cref="Trigger" />s.
        /// </summary>
        /// <returns> true if the Job was found and deleted.</returns>
        public virtual bool DeleteJob(SchedulingContext ctxt, string jobName, string groupName)
        {
            ValidateState();

            if (groupName == null)
            {
                groupName = SchedulerConstants.DefaultGroup;
            }

            return resources.JobStore.RemoveJob(ctxt, jobName, groupName);
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:16,代码来源:QuartzScheduler.cs

示例6: ScheduleJob

        /// <summary>
        /// Schedule the given <see cref="Trigger" /> with the
        /// <see cref="IJob" /> identified by the <see cref="Trigger" />'s settings.
        /// </summary>
        public virtual DateTime ScheduleJob(SchedulingContext ctxt, Trigger trigger)
        {
            ValidateState();

            if (trigger == null)
            {
                throw new SchedulerException("Trigger cannot be null",
                        SchedulerException.ErrorClientError);
            }

            trigger.Validate();

            ICalendar cal = null;
            if (trigger.CalendarName != null)
            {
                cal = resources.JobStore.RetrieveCalendar(ctxt, trigger.CalendarName);
                if (cal == null)
                {
                    throw new SchedulerException(string.Format(CultureInfo.InvariantCulture, "Calendar not found: {0}", trigger.CalendarName),
                                                 SchedulerException.ErrorPersistenceCalendarDoesNotExist);
                }
            }

            NullableDateTime ft = trigger.ComputeFirstFireTimeUtc(cal);

            if (!ft.HasValue)
            {
                throw new SchedulerException("Based on configured schedule, the given trigger will never fire.",
                                             SchedulerException.ErrorClientError);
            }

            resources.JobStore.StoreTrigger(ctxt, trigger, false);
            NotifySchedulerThread(trigger.GetNextFireTimeUtc());
            NotifySchedulerListenersScheduled(trigger);

            return ft.Value;
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:41,代码来源:QuartzScheduler.cs

示例7: QuartzScheduler

        /// <summary>
        /// Create a <see cref="QuartzScheduler" /> with the given configuration
        /// properties.
        /// </summary>
        /// <seealso cref="QuartzSchedulerResources" />
        public QuartzScheduler(QuartzSchedulerResources resources, SchedulingContext ctxt, TimeSpan idleWaitTime, TimeSpan dbRetryInterval)
        {
            Log = LogManager.GetLogger(GetType());
            this.resources = resources;
            try
            {
                Bind();
            }
            catch (Exception re)
            {
                throw new SchedulerException("Unable to bind scheduler to remoting context.", re);
            }

            schedThread = new QuartzSchedulerThread(this, resources, ctxt);
            if (idleWaitTime > TimeSpan.Zero)
            {
                schedThread.IdleWaitTime = idleWaitTime;
            }
            if (dbRetryInterval > TimeSpan.Zero)
            {
                schedThread.DbFailureRetryInterval = dbRetryInterval;
            }

            jobMgr = new ExecutingJobsManager();
            AddGlobalJobListener(jobMgr);
            errLogger = new ErrorLogger();
            AddSchedulerListener(errLogger);

            signaler = new SchedulerSignalerImpl(this, this.schedThread);

            Log.Info(string.Format(CultureInfo.InvariantCulture, "Quartz Scheduler v.{0} created.", Version));
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:37,代码来源:QuartzScheduler.cs

示例8: Interrupt

        /// <summary>
        /// Interrupt all instances of the identified InterruptableJob.
        /// </summary>
        public virtual bool Interrupt(SchedulingContext ctxt, string jobName, string groupName)
        {
            if (groupName == null)
            {
                groupName = SchedulerConstants.DefaultGroup;
            }

            IList jobs = CurrentlyExecutingJobs;

            JobDetail jobDetail;

            bool interrupted = false;

            foreach (JobExecutionContext jec in jobs)
            {
                jobDetail = jec.JobDetail;
                if (jobName.Equals(jobDetail.Name) && groupName.Equals(jobDetail.Group))
                {
                    IJob job = jec.JobInstance;
                    if (job is IInterruptableJob)
                    {
                        ((IInterruptableJob)job).Interrupt();
                        interrupted = true;
                    }
                    else
                    {
                        throw new UnableToInterruptJobException(string.Format(CultureInfo.InvariantCulture, "Job '{0}' of group '{1}' can not be interrupted, since it does not implement {2}", jobName, groupName, typeof(IInterruptableJob).FullName));
                    }
                }
            }

            return interrupted;
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:36,代码来源:QuartzScheduler.cs

示例9: GetTriggersOfJob

        /// <summary> 
        /// Get all <see cref="Trigger" /> s that are associated with the
        /// identified <see cref="JobDetail" />.
        /// </summary>
        public virtual Trigger[] GetTriggersOfJob(SchedulingContext ctxt, string jobName, string groupName)
        {
            ValidateState();

            if (groupName == null)
            {
                groupName = SchedulerConstants.DefaultGroup;
            }

            return resources.JobStore.GetTriggersForJob(ctxt, jobName, groupName);
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:15,代码来源:QuartzScheduler.cs

示例10: ResumeAll

        /// <summary>
        /// Resume (un-pause) all triggers - equivalent of calling <see cref="ResumeTriggerGroup(SchedulingContext, string)" />
        /// on every group.
        /// <p>
        /// If any <see cref="Trigger" /> missed one or more fire-times, then the
        /// <see cref="Trigger" />'s misfire instruction will be applied.
        /// </p>
        /// </summary>
        /// <seealso cref="PauseAll(SchedulingContext)" />
        public virtual void ResumeAll(SchedulingContext ctxt)
        {
            ValidateState();

            resources.JobStore.ResumeAll(ctxt);
            NotifySchedulerThread(null);
            NotifySchedulerListenersResumedTrigger(null, null);
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:17,代码来源:QuartzScheduler.cs

示例11: ResumeJobGroup

        /// <summary>
        /// Resume (un-pause) all of the <see cref="JobDetail" />s
        /// in the given group.
        /// <p>
        /// If any of the <see cref="IJob" /> s had <see cref="Trigger" /> s that
        /// missed one or more fire-times, then the <see cref="Trigger" />'s
        /// misfire instruction will be applied.
        /// </p>
        /// </summary>
        public virtual void ResumeJobGroup(SchedulingContext ctxt, string groupName)
        {
            ValidateState();

            if (groupName == null)
            {
                groupName = SchedulerConstants.DefaultGroup;
            }

            resources.JobStore.ResumeJobGroup(ctxt, groupName);
            NotifySchedulerThread(null);
            NotifySchedulerListenersResumedJob(null, groupName);
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:22,代码来源:QuartzScheduler.cs

示例12: GetPausedTriggerGroups

 /// <summary>
 /// Gets the paused trigger groups.
 /// </summary>
 /// <param name="ctxt">The the job scheduling context.</param>
 /// <returns></returns>
 public virtual ISet GetPausedTriggerGroups(SchedulingContext ctxt)
 {
     return resources.JobStore.GetPausedTriggerGroups(ctxt);
 }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:9,代码来源:QuartzScheduler.cs

示例13: StoreJob

 /// <summary>
 /// Stores the given <see cref="JobDetail" />.
 /// </summary>
 /// <param name="ctxt"></param>
 /// <param name="newJob">The <see cref="JobDetail" /> to be stored.</param>
 /// <param name="replaceExisting">
 /// If <see langword="true" />, any <see cref="IJob" /> existing in the
 /// <see cref="IJobStore" /> with the same name &amp; group should be over-written.
 /// </param>
 public void StoreJob(SchedulingContext ctxt, JobDetail newJob, bool replaceExisting)
 {
     ExecuteInLock(
         (LockOnInsert || replaceExisting) ? LockTriggerAccess : null,
         new StoreJobCallback(this, ctxt, newJob, replaceExisting));
 }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:15,代码来源:JobStoreSupport.cs

示例14: StoreJobAndTriggerCallback

 public StoreJobAndTriggerCallback(JobStoreSupport js, JobDetail newJob, Trigger newTrigger,
                                   SchedulingContext ctxt)
     : base(js)
 {
     this.newJob = newJob;
     this.newTrigger = newTrigger;
     this.ctxt = ctxt;
 }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:8,代码来源:JobStoreSupport.cs

示例15: IsTriggerGroupPaused

 /// <summary>
 /// returns true if the given TriggerGroup
 /// is paused
 /// </summary>
 /// <param name="ctxt"></param>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public bool IsTriggerGroupPaused(SchedulingContext ctxt, string groupName)
 {
     throw new NotImplementedException();
 }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:11,代码来源:JobStoreSupport.cs


注:本文中的Quartz.Core.SchedulingContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。