Class JobBuilderHelper<B extends JobBuilderHelper<B>>
java.lang.Object
org.springframework.batch.core.job.builder.JobBuilderHelper<B>
- Direct Known Subclasses:
FlowJobBuilder
,JobBuilder
,SimpleJobBuilder
A base class and utility for other job builders providing access to common properties
like job repository.
- Since:
- 2.2
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionJobBuilderHelper
(String name) protected
JobBuilderHelper
(JobBuilderHelper<?> parent) Create a new builder initialized with any properties in the parent. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected JobRepository
protected String
getName()
incrementer
(JobParametersIncrementer jobParametersIncrementer) Add a job parameters incrementer.protected boolean
Registers objects using the annotation based listener configuration.listener
(JobExecutionListener listener) Register a job execution listener.Set a flag to prevent restart an execution of this job even if it has failed.repository
(JobRepository jobRepository) Sets the job repository for the job.validator
(JobParametersValidator jobParametersValidator) Add a job parameters validator.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
JobBuilderHelper
-
JobBuilderHelper
Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.- Parameters:
parent
- a parent helper containing common step properties
-
-
Method Details
-
validator
Add a job parameters validator.- Parameters:
jobParametersValidator
- a job parameters validator- Returns:
- this to enable fluent chaining
-
incrementer
Add a job parameters incrementer.- Parameters:
jobParametersIncrementer
- a job parameters incrementer- Returns:
- this to enable fluent chaining
-
repository
Sets the job repository for the job.- Parameters:
jobRepository
- the job repository (mandatory)- Returns:
- this to enable fluent chaining
-
listener
Registers objects using the annotation based listener configuration.- Parameters:
listener
- the object that has a method configured with listener annotation- Returns:
- this for fluent chaining
-
listener
Register a job execution listener.- Parameters:
listener
- a job execution listener- Returns:
- this to enable fluent chaining
-
preventRestart
Set a flag to prevent restart an execution of this job even if it has failed.- Returns:
- this to enable fluent chaining
-
getName
-
getJobRepository
-
isRestartable
protected boolean isRestartable() -
enhance
-