C# Class Summer.Batch.Core.Launch.Support.SimpleJobLauncher

Simple implementation of the IJobLauncher interface. The ITaskExecutor interface is used to launch a Job. This means that the type of executor set is very important. If a SyncTaskExecutor is used, then the job will be processed within the same thread that called the launcher. Care should be taken to ensure any users of this class understand fully whether or not the implementation of TaskExecutor used will start tasks synchronously or asynchronously. The default setting uses a synchronous task executor. There is only one required dependency of this Launcher, an IJobRepository. The IJobRepository is used to obtain a valid JobExecution. The Repository must be used because the provided Job could be a restart of an existing JobInstance, and only the Repository can reliably recreate it.
Inheritance: IJobLauncher, IInitializationPostOperations
Show file Open project: SummerBatch/SummerBatch Class Usage Examples

Protected Properties

Property Type Description
Logger Logger

Public Methods

Method Description
AfterPropertiesSet ( ) : void

Ensure the required dependencies of an IJobRepository have been set. Used programmatically by JobStepBuilder see IInitializationPostOperations#AfterPropertiesSet

Run ( IJob job, JobParameters jobParameters ) : JobExecution

Runs the provided job with the given JobParameters. The JobParameters will be used to determine if this is an execution of an existing job instance, or if a new one should be created.

Private Methods

Method Description
CreateJobAction ( IJob job, JobParameters jobParameters, JobExecution jobExecution ) : System.Action

Action creation helper. Given a job, job parameters and a job execution, will wrap the execution of the job into a System.Action.

HandleLastExecution ( IJob job, JobExecution lastExecution ) : void

Manage last job execution if required.

Method Details

AfterPropertiesSet() public method

Ensure the required dependencies of an IJobRepository have been set. Used programmatically by JobStepBuilder see IInitializationPostOperations#AfterPropertiesSet
public AfterPropertiesSet ( ) : void
return void

Run() public method

Runs the provided job with the given JobParameters. The JobParameters will be used to determine if this is an execution of an existing job instance, or if a new one should be created.
  if the execution would be a re-start, but a re-start is either not allowed or not needed.  if the JobInstance already exists and has an execution already running   if this instance has already completed successfully  if given parameters do not pass validation process
public Run ( IJob job, JobParameters jobParameters ) : JobExecution
job IJob
jobParameters JobParameters
return JobExecution

Property Details

Logger protected static property

Logger.
protected static Logger Logger
return Logger