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


C# IJobExecutionContext.Get方法代码示例

本文整理汇总了C#中IJobExecutionContext.Get方法的典型用法代码示例。如果您正苦于以下问题:C# IJobExecutionContext.Get方法的具体用法?C# IJobExecutionContext.Get怎么用?C# IJobExecutionContext.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IJobExecutionContext的用法示例。


在下文中一共展示了IJobExecutionContext.Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JobWasExecuted

        public void JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException)
        {
            JobExecutionData data = context.Get("JobExecutionData") as JobExecutionData;
            if (data != null)
            {
                data.JobEndTime = DateTime.Now;
                lock (_Data)
                {
                    if (_Data.Count > _Capacity)
                    {
                        _Data.RemoveAt(0);
                    }
                    _Data.Add(data);

                }
            }
        }
开发者ID:GoneFishern,项目名称:QuartzNetFeaturePack,代码行数:17,代码来源:JobFeedListener.cs

示例2: OnExecute

        private void OnExecute(IJobExecutionContext context)
        {
            Log4NetLogger.Instance.Info(string.Format("FileMonitoringJob with ID {0}  Invoked.", jobSetting.Id));

            try
            {
                jobSetting = (FileJobSetting)context.Get("JobSetting");
                //TODO: Processing based on FileJobSetting and notification (DB and Live)

                HubProxy.Invoke(AppSettingsValues.EventToAdmin, true, "FileMonitoringJob Executed on " + DateTime.Now);

            }
            catch (Exception ex)
            {
                Log4NetLogger.Instance.Error(ex);
            }
            Log4NetLogger.Instance.Info(string.Format("FileMonitoringJob with ID {0}  Completed.", jobSetting.Id));
        }
开发者ID:rahulgarg1985,项目名称:CDMRS,代码行数:18,代码来源:FileMonitoringJob.cs

示例3: Execute

        public void Execute(IJobExecutionContext context)
        {
            try
            {
                var urls = context.Get("urls").ToString().Split(',');

                urls.ToList().ForEach(url =>
                {
                    var request = (HttpWebRequest)WebRequest.Create(url);
                    var s = new Stopwatch();
                    s.Start();
                    using (var response = (HttpWebResponse)request.GetResponse())
                    using (var stream = response.GetResponseStream())
                    {
                        string ret = string.Empty;
                        if (stream != null)
                        {
                            string readToEnd = new StreamReader(stream).ReadToEnd();
                            ret = string.Format("{0}...", readToEnd.Substring(0, 500));
                        }
                        s.Stop();

                        Publish(new PingerModel()
                        {
                            Time = DateTime.Now,
                            Url = url,
                            response = ret,
                            Status = response.StatusCode.ToString(),
                            StatusDescription = response.StatusDescription,
                            Duration = s.Elapsed,
                            ContentLength = response.ContentLength,
                            ContentType = response.ContentType
                        });
                    }
                });
            }
            catch (Exception ex)
            {
                throw new JobExecutionException(ex);
            }
        }
开发者ID:thatandyrose,项目名称:appharbor-workers,代码行数:41,代码来源:Pinger.cs

示例4: Execute

 public void Execute(IJobExecutionContext context)
 {
     var csvProcessor = context.Get("processor") as CsvProcessor;
     RunJob(csvProcessor);
 }
开发者ID:ojoadeolagabriel,项目名称:TqWorkflow-beta,代码行数:5,代码来源:CsvConsumer.cs


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