Package org.springframework.batch.core
Interface Job
- All Known Implementing Classes:
AbstractJob
,FlowJob
,GroupAwareJob
,JsrFlowJob
,SimpleJob
public interface Job
Batch domain object representing a job. Job is an explicit abstraction representing the configuration of a job specified by a developer. It should be noted that restart policy is applied to the job as a whole and not to a step.- Author:
- Dave Syer, Mahmoud Ben Hassine
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(JobExecution execution)
Run theJobExecution
and update the meta information like status and statistics as necessary.JobParametersIncrementer
getJobParametersIncrementer()
If clients need to generate new parameters for the next execution in a sequence they can use this incrementer.JobParametersValidator
getJobParametersValidator()
A validator for the job parameters of aJobExecution
.java.lang.String
getName()
boolean
isRestartable()
Flag to indicate if this job can be restarted, at least in principle.
Method Detail
getName
java.lang.String getName()
isRestartable
boolean isRestartable()
Flag to indicate if this job can be restarted, at least in principle.- Returns:
- true if this job can be restarted after a failure
execute
void execute(JobExecution execution)
Run theJobExecution
and update the meta information like status and statistics as necessary. This method should not throw any exceptions for failed execution. Clients should be careful to inspect theJobExecution
status to determine success or failure.- Parameters:
execution
- aJobExecution
getJobParametersIncrementer
@Nullable JobParametersIncrementer getJobParametersIncrementer()
If clients need to generate new parameters for the next execution in a sequence they can use this incrementer. The return value may benull
, in the case that this job does not have a natural sequence.- Returns:
- in incrementer to be used for creating new parameters
getJobParametersValidator
JobParametersValidator getJobParametersValidator()
A validator for the job parameters of aJobExecution
. Clients of a Job may need to validate the parameters for a launch, before or during the execution.- Returns:
- a validator that can be used to check parameter values (never
null
)