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


C# IStep.Execute方法代码示例

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


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

示例1: HandleStepExecution

        /// <summary>
        /// Handle normal step execution.
        /// </summary>
        /// <param name="step"></param>
        /// <param name="execution"></param>
        /// <param name="currentStepExecution"></param>
        private void HandleStepExecution(IStep step, JobExecution execution, StepExecution currentStepExecution)
        {
            JobRepository.Add(currentStepExecution);
            Logger.Info("Executing step: [ {0} ]", step.Name);
            try
            {
                step.Execute(currentStepExecution);
                currentStepExecution.ExecutionContext.Put("batch.executed", true);
            }
            catch (JobInterruptedException)
            {
                // Ensure that the job gets the message that it is stopping
                // and can pass it on to other steps that are executing
                // concurrently.
                execution.Status = BatchStatus.Stopping;
                throw;
            }

            JobRepository.UpdateExecutionContext(execution);
        }
开发者ID:pkubryk,项目名称:SummerBatch,代码行数:26,代码来源:SimpleStepHandler.cs

示例2: CreateTask

 /// <summary>
 /// Creates a task to be executed later on for the given stepExecution.
 /// </summary>
 /// <param name="step"></param>
 /// <param name="stepExecution"></param>
 /// <returns></returns>
 protected Task<StepExecution> CreateTask(IStep step, StepExecution stepExecution)
 {
     return new Task<StepExecution>(() =>
     {
         step.Execute(stepExecution);
         return stepExecution;
     });
 }
开发者ID:pkubryk,项目名称:SummerBatch,代码行数:14,代码来源:TaskExecutorPartitionHandler.cs


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