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, Taeik Lim
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionJobBuilderHelper(String name) protectedJobBuilderHelper(JobBuilderHelper<?> parent) Create a new builder initialized with any properties in the parent. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidenhance(AbstractJob job) protected JobRepositoryprotected StringgetName()incrementer(JobParametersIncrementer jobParametersIncrementer) Add a job parameters incrementer.protected booleanRegisters objects using the annotation based listener configuration.listener(JobExecutionListener listener) Register a job execution listener.meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Sets the meter registry for the job.observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Sets the observation registry for the job.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
-
observationRegistry
Sets the observation registry for the job.- Parameters:
observationRegistry- the observation registry (optional)- Returns:
- this to enable fluent chaining
-
meterRegistry
Sets the meter registry for the job.- Parameters:
meterRegistry- the meter registry (optional)- 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
-