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


C# Core.QuartzScheduler类代码示例

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


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

示例1: SchedulerSignalerImpl

        public SchedulerSignalerImpl(QuartzScheduler sched, QuartzSchedulerThread schedThread)
        {
            this.sched = sched;
            this.schedThread = schedThread;

            log.Info("Initialized Scheduler Signaller of type: " + GetType());
        }
开发者ID:vaskosound,项目名称:FantasyLeagueStats,代码行数:7,代码来源:SchedulerSignalerImpl.cs

示例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);
        }
开发者ID:jvilalta,项目名称:quartznet,代码行数:29,代码来源:JobRunShell.cs

示例3: 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);
		}
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:29,代码来源:JobRunShell.cs

示例4: QuartzSchedulerThread

        /// <summary>
        /// Construct a new <see cref="QuartzSchedulerThread" /> for the given
        /// <see cref="QuartzScheduler" /> as a <see cref="Thread" /> with the given
        /// attributes.
        /// </summary>
        internal QuartzSchedulerThread(QuartzScheduler qs, QuartzSchedulerResources qsRsrcs, 
                                       bool setDaemon, int threadPrio)
            : base(qsRsrcs.ThreadName)
        {
            //ThreadGroup generatedAux = qs.SchedulerThreadGroup;
            this.qs = qs;
            this.qsRsrcs = qsRsrcs;
            IsBackground = setDaemon;
            Priority = (ThreadPriority) threadPrio;

            // start the underlying thread, but put this object into the 'paused'
            // state
            // so processing doesn't start yet...
            paused = true;
            halted = false;
        }
开发者ID:rowlek,项目名称:Rock-ChMS,代码行数:21,代码来源:QuartzSchedulerThread.cs

示例5: SchedulerSignalerImpl

 public SchedulerSignalerImpl(QuartzScheduler sched, QuartzSchedulerThread schedThread)
 {
     this.sched = sched;
     this.schedThread = schedThread;
 }
开发者ID:jondhinkle,项目名称:Rock,代码行数:5,代码来源:SchedulerSignalerImpl.cs

示例6: QuartzSchedulerThread

 /// <summary>
 /// Construct a new <see cref="QuartzSchedulerThread" /> for the given
 /// <see cref="QuartzScheduler" /> as a non-daemon <see cref="Thread" />
 /// with normal priority.
 /// </summary>
 internal QuartzSchedulerThread(QuartzScheduler qs, QuartzSchedulerResources qsRsrcs)
     : this(qs, qsRsrcs, qsRsrcs.MakeSchedulerThreadDaemon, (int) ThreadPriority.Normal)
 {
 }
开发者ID:natenho,项目名称:quartznet,代码行数:9,代码来源:QuartzSchedulerThread.cs

示例7: DelayedSchedulerStarter

 public DelayedSchedulerStarter(QuartzScheduler scheduler, TimeSpan delay)
 {
     this.scheduler = scheduler;
     this.delay = delay;
 }
开发者ID:jondhinkle,项目名称:Rock,代码行数:5,代码来源:QuartzScheduler.cs

示例8: SetFactory

 protected void SetFactory(QuartzScheduler qs)
 {
     qs.JobFactory = _unityJobFactory;
 }
开发者ID:cutstock,项目名称:SampleWebService,代码行数:4,代码来源:UnitySchedulerFactory.cs

示例9: Instantiate

 protected override IScheduler Instantiate(QuartzSchedulerResources rsrcs, QuartzScheduler qs)
 {
     SetFactory(qs);
     return base.Instantiate(rsrcs, qs);
 }
开发者ID:cutstock,项目名称:SampleWebService,代码行数:5,代码来源:UnitySchedulerFactory.cs

示例10: StdScheduler

 /// <summary>
 /// Construct a <see cref="StdScheduler" /> instance to proxy the given
 /// <see cref="QuartzScheduler" /> instance.
 /// </summary>
 public StdScheduler(QuartzScheduler sched)
 {
     this.sched = sched;
 }
开发者ID:CharlieBP,项目名称:quartznet,代码行数:8,代码来源:StdScheduler.cs

示例11: Instantiate

 protected override IScheduler Instantiate(QuartzSchedulerResources rsrcs, QuartzScheduler qs)
 {
     var scheduler = base.Instantiate(rsrcs, qs);
     scheduler.JobFactory = _abpJobFactory;
     return scheduler;
 }
开发者ID:MadBullfrog,项目名称:Topshelf.Abp.Integrations,代码行数:6,代码来源:AbpSchedulerFactory.cs

示例12: Run

        /// <summary>
        /// The main processing loop of the <see cref="QuartzSchedulerThread" />.
        /// </summary>
        public override void Run()
        {
            bool lastAcquireFailed = false;

            while (!halted)
            {
                try
                {
                    // check if we're supposed to pause...
                    lock (sigLock)
                    {
                        while (paused && !halted)
                        {
                            try
                            {
                                // wait until togglePause(false) is called...
                                Monitor.Wait(sigLock, 1000);
                            }
                            catch (ThreadInterruptedException)
                            {
                            }
                        }

                        if (halted)
                        {
                            break;
                        }
                    }

                    int availTreadCount = qsRsrcs.ThreadPool.BlockForAvailableThreads();
                    if (availTreadCount > 0) // will always be true, due to semantics of blockForAvailableThreads...
                    {
                        Trigger trigger = null;

                        DateTime now = DateTime.UtcNow;

                        ClearSignaledSchedulingChange();
                        try
                        {
                            trigger = qsRsrcs.JobStore.AcquireNextTrigger(ctxt, now.Add(idleWaitTime));
                            lastAcquireFailed = false;
                        }
                        catch (JobPersistenceException jpe)
                        {
                            if (!lastAcquireFailed)
                            {
                                qs.NotifySchedulerListenersError(
                                    "An error occured while scanning for the next trigger to fire.",
                                    jpe);
                            }
                            lastAcquireFailed = true;
                        }
                        catch (Exception e)
                        {
                            if (!lastAcquireFailed)
                            {
                                Log.Error("quartzSchedulerThreadLoop: RuntimeException "
                                          + e.Message, e);
                            }
                            lastAcquireFailed = true;
                        }

                        if (trigger != null)
                        {
                            now = DateTime.UtcNow;
                            DateTime triggerTime = trigger.GetNextFireTimeUtc().Value;
                            TimeSpan timeUntilTrigger =  triggerTime - now;

                            while (timeUntilTrigger > TimeSpan.Zero) 
                            {
                                lock (sigLock)
                                {
                                    try
                                    {
                                        // we could have blocked a long while
                                        // on 'synchronize', so we must recompute
                                        now = DateTime.UtcNow;
                                        timeUntilTrigger = triggerTime - now;
                                        if (timeUntilTrigger.TotalMilliseconds >= 1)
                                        {
                                            Monitor.Wait(sigLock, timeUntilTrigger);
                                        }
                                    }
                                    catch (ThreadInterruptedException)
                                    {
                                    }
                                }
                                if (IsScheduleChanged())
                                {
                                    if (IsCandidateNewTimeEarlierWithinReason(triggerTime))
                                    {
                                        // above call does a clearSignaledSchedulingChange()
                                        try
                                        {
                                            qsRsrcs.JobStore.ReleaseAcquiredTrigger(ctxt, trigger);
                                        }
                                        catch (JobPersistenceException jpe)
//.........这里部分代码省略.........
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:101,代码来源:QuartzSchedulerThread.cs

示例13: QuartzSchedulerThread

        /// <summary>
        /// Construct a new <see cref="QuartzSchedulerThread" /> for the given
        /// <see cref="QuartzScheduler" /> as a <see cref="Thread" /> with the given
        /// attributes.
        /// </summary>
        internal QuartzSchedulerThread(QuartzScheduler qs, QuartzSchedulerResources qsRsrcs, SchedulingContext ctxt,
                                       bool setDaemon, int threadPrio) : base(qsRsrcs.ThreadName)
        {
            log = LogManager.GetLogger(GetType());
            //ThreadGroup generatedAux = qs.SchedulerThreadGroup;
            this.qs = qs;
            this.qsRsrcs = qsRsrcs;
            this.ctxt = ctxt;
            IsBackground = setDaemon;
            Priority = (ThreadPriority) threadPrio;

            // start the underlying thread, but put this object into the 'paused'
            // state
            // so processing doesn't start yet...
            paused = true;
            halted = false;
            Start();
        }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:23,代码来源:QuartzSchedulerThread.cs

示例14: Instantiate

 protected override IScheduler Instantiate(QuartzSchedulerResources resources, QuartzScheduler qs)
 {
     IScheduler scheduler = base.Instantiate(resources, qs);
     scheduler.JobFactory = kernel.Resolve<IJobFactory>();
     return scheduler;
 }
开发者ID:bevacqua,项目名称:Swarm,代码行数:6,代码来源:WindsorSchedulerFactory.cs

示例15: Instantiate

 protected override IScheduler Instantiate(QuartzSchedulerResources resources, QuartzScheduler quartzScheduler) {
     var scheduler = base.Instantiate(resources, quartzScheduler);
     return scheduler is StdScheduler ? new XpandScheduler(quartzScheduler, _application) : scheduler;
 }
开发者ID:aries544,项目名称:eXpand,代码行数:4,代码来源:XpandSchedulerFactory.cs


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