Summer.Batch.Core.Job.AbstractJob Class Referenceabstract

Abstract implementation of the IJob interface. Common dependencies such as a IJobRepository, IJobExecutionListener's, and various configuration parameters are set here. Therefore, common error handling and listener calling activities are abstracted away from implementations. More...

Inheritance diagram for Summer.Batch.Core.Job.AbstractJob:
Summer.Batch.Core.IJob Summer.Batch.Core.Step.IStepLocator Summer.Batch.Common.Factory.IInitializationPostOperations Summer.Batch.Core.Job.Flow.FlowJob Summer.Batch.Core.Job.SimpleJob

Public Member Functions

void Execute (JobExecution execution)
 Executes job. More...
 
abstract ICollection< string > GetStepNames ()
 To be overriden by subclasses. More...
 
abstract IStep GetStep (string stepName)
 To be overriden by subclasses. More...
 
override string ToString ()
 ToString override. More...
 
void AfterPropertiesSet ()
 Post-init. checks. More...
 
void SetJobExecutionListeners (IJobExecutionListener[] listeners)
 Public setter for injecting IJobExecutionListeners. They will all be given the listener callbacks at the appropriate point in the job. More...
 
void RegisterJobExecutionListener (IJobExecutionListener listener)
 Register a single listener for the IJobExecutionListener callbacks. More...
 

Protected Member Functions

 AbstractJob ()
 Default constructor. More...
 
 AbstractJob (string name)
 Custom constructor with a name. More...
 
abstract void DoExecute (JobExecution execution)
 Actual job execution. To be implemented by sub-classes. More...
 
StepExecution HandleStep (IStep step, JobExecution execution)
 Convenience method for subclasses to delegate the handling of a specific step in the context of the current JobExecution . Clients of this method do not need access to the JobRepository, nor do they need to worry about populating the execution context on a restart, nor detecting the interrupted state (in job or step execution). More...
 
ExitStatus GetDefaultExitStatusForFailure (Exception ex, JobExecution execution)
 Computes exit status depending on exception. More...
 

Static Protected Attributes

static readonly Logger Logger = LogManager.GetCurrentClassLogger()
 Logger. More...
 

Properties

string Name [get, set]
 Name property. More...
 
bool Restartable [get, set]
 Restartable flag property. More...
 
IJobParametersIncrementer JobParametersIncrementer [get, set]
 job parameters incrementer property. More...
 
IJobParametersValidator JobParametersValidator [get, set]
 Job parameters validator property. More...
 
IJobRepository JobRepository [get, set]
 Job repository property. More...
 
- Properties inherited from Summer.Batch.Core.IJob
string Name [get, set]
 Name. More...
 
bool Restartable [get, set]
 Flag to indicate if this job can be restarted, at least in principle (Actual restartability is bound to the use of a persisted job repository). More...
 
IJobParametersIncrementer JobParametersIncrementer [get, set]
 If clients need to generate new parameters for the next execution in a sequence they can use this incrementer. The return value may be null, in the case that this job does not have a natural sequence. More...
 
IJobParametersValidator JobParametersValidator [get, set]
 A validator for the job parameters of a JobExecution. Clients of a Job may need to validate the parameters for a launch, before or during the execution. More...
 

Detailed Description

Abstract implementation of the IJob interface. Common dependencies such as a IJobRepository, IJobExecutionListener's, and various configuration parameters are set here. Therefore, common error handling and listener calling activities are abstracted away from implementations.

Constructor & Destructor Documentation

Summer.Batch.Core.Job.AbstractJob.AbstractJob ( )
protected

Default constructor.

Summer.Batch.Core.Job.AbstractJob.AbstractJob ( string  name)
protected

Custom constructor with a name.

Parameters
name

Member Function Documentation

void Summer.Batch.Core.Job.AbstractJob.AfterPropertiesSet ( )

Post-init. checks.

See also
IInitializationPostOperations::AfterPropertiesSet.

Implements Summer.Batch.Common.Factory.IInitializationPostOperations.

abstract void Summer.Batch.Core.Job.AbstractJob.DoExecute ( JobExecution  execution)
protectedpure virtual

Actual job execution. To be implemented by sub-classes.

Parameters
execution
Exceptions
JobExecutionException 

Implemented in Summer.Batch.Core.Job.SimpleJob, and Summer.Batch.Core.Job.Flow.FlowJob.

void Summer.Batch.Core.Job.AbstractJob.Execute ( JobExecution  execution)

Executes job.

Parameters
execution

Implements Summer.Batch.Core.IJob.

ExitStatus Summer.Batch.Core.Job.AbstractJob.GetDefaultExitStatusForFailure ( Exception  ex,
JobExecution  execution 
)
protected

Computes exit status depending on exception.

Parameters
ex
execution
Returns
abstract IStep Summer.Batch.Core.Job.AbstractJob.GetStep ( string  stepName)
pure virtual

To be overriden by subclasses.

Parameters
stepName
Returns

Implements Summer.Batch.Core.Step.IStepLocator.

Implemented in Summer.Batch.Core.Job.Flow.FlowJob, and Summer.Batch.Core.Job.SimpleJob.

abstract ICollection<string> Summer.Batch.Core.Job.AbstractJob.GetStepNames ( )
pure virtual

To be overriden by subclasses.

Returns

Implements Summer.Batch.Core.Step.IStepLocator.

Implemented in Summer.Batch.Core.Job.SimpleJob, and Summer.Batch.Core.Job.Flow.FlowJob.

StepExecution Summer.Batch.Core.Job.AbstractJob.HandleStep ( IStep  step,
JobExecution  execution 
)
protected

Convenience method for subclasses to delegate the handling of a specific step in the context of the current JobExecution . Clients of this method do not need access to the JobRepository, nor do they need to worry about populating the execution context on a restart, nor detecting the interrupted state (in job or step execution).

Parameters
stepthe step to execute
executionthe current job execution
Returns
Exceptions
JobInterruptedException 
JobRestartException 
StartLimitExceededException 
void Summer.Batch.Core.Job.AbstractJob.RegisterJobExecutionListener ( IJobExecutionListener  listener)

Register a single listener for the IJobExecutionListener callbacks.

Parameters
listener
void Summer.Batch.Core.Job.AbstractJob.SetJobExecutionListeners ( IJobExecutionListener[]  listeners)

Public setter for injecting IJobExecutionListeners. They will all be given the listener callbacks at the appropriate point in the job.

Parameters
listeners
override string Summer.Batch.Core.Job.AbstractJob.ToString ( )

ToString override.

Returns

Member Data Documentation

readonly Logger Summer.Batch.Core.Job.AbstractJob.Logger = LogManager.GetCurrentClassLogger()
staticprotected

Logger.

Property Documentation

IJobParametersIncrementer Summer.Batch.Core.Job.AbstractJob.JobParametersIncrementer
getset

job parameters incrementer property.

IJobParametersValidator Summer.Batch.Core.Job.AbstractJob.JobParametersValidator
getset

Job parameters validator property.

IJobRepository Summer.Batch.Core.Job.AbstractJob.JobRepository
getset

Job repository property.

string Summer.Batch.Core.Job.AbstractJob.Name
getset

Name property.

bool Summer.Batch.Core.Job.AbstractJob.Restartable
getset

Restartable flag property.


The documentation for this class was generated from the following file:
  • Summer.Batch.Core/Core/Job/AbstractJob.cs