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) Deprecated, for removal: This API element is subject to removal in a future version.JobBuilderHelper(String name, JobRepository jobRepository) Create a newJobBuilderHelper.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.observationConvention(BatchJobObservationConvention observationConvention) Sets the job observation convention.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) Deprecated, for removal: This API element is subject to removal in a future version.validator(JobParametersValidator jobParametersValidator) Add a job parameters validator.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
JobBuilderHelper
Deprecated, for removal: This API element is subject to removal in a future version.Create a newJobBuilderHelper.- Parameters:
name- the job name
-
JobBuilderHelper
Create a newJobBuilderHelper.- Parameters:
name- the job namejobRepository- the job repository- Since:
- 5.1
-
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
Deprecated, for removal: This API element is subject to removal in a future version.Sets the job repository for the job.- Parameters:
jobRepository- the job repository (mandatory)- Returns:
- this to enable fluent chaining
-
observationConvention
Sets the job observation convention.- Parameters:
observationConvention- the job observation convention (optional)- Returns:
- this to enable fluent chaining
- Since:
- 5.1
-
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
-
JobBuilderHelper(String, JobRepository)