Summer.Batch.Core.Launch.Support.SimpleJobLauncher.CreateJobAction C# (CSharp) Method

CreateJobAction() private static method

Action creation helper. Given a job, job parameters and a job execution, will wrap the execution of the job into a System.Action.
private static CreateJobAction ( IJob job, JobParameters jobParameters, JobExecution jobExecution ) : System.Action
job IJob the job to execute
jobParameters JobParameters the job parameters
jobExecution JobExecution the job execution
return System.Action
        private static Action CreateJobAction(IJob job, JobParameters jobParameters, JobExecution jobExecution)
        {
            Action jobAction = (() =>
            {
                try
                {
                    Logger.Info("Job: [{0} ] launched with the following parameters:[{1}]",job,jobParameters);
                    job.Execute(jobExecution);
                    Logger.Info("Job: [{0}] completed with the following parameters:[{1}] and the following status: [{2}]",
                                 job,jobParameters,jobExecution.Status);

                }
                catch (Exception exception)
                {
                    Logger.Info("Job: [{0}] failed unexpectedly and fatally with the following parameters: [{1}]",job,exception);
                     throw;
                }
            });
            return jobAction;
        }