Class StepBuilder
java.lang.Object
org.springframework.batch.core.step.builder.StepBuilderHelper<StepBuilder>
org.springframework.batch.core.step.builder.StepBuilder
- Direct Known Subclasses:
RemotePartitioningWorkerStepBuilder
Convenient entry point for building all kinds of steps. Use this as a factory for
fluent builders of any step.
- Since:
- 2.2
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
StepBuilderHelper.CommonStepProperties
-
Field Summary
Fields inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties
-
Constructor Summary
ConstructorDescriptionStepBuilder
(String name) Deprecated, for removal: This API element is subject to removal in a future version.StepBuilder
(String name, JobRepository jobRepository) Initialize a step builder for a step with the given name and job repository. -
Method Summary
Modifier and TypeMethodDescription<I,
O> SimpleStepBuilder<I, O> chunk
(int chunkSize) Deprecated, for removal: This API element is subject to removal in a future version.<I,
O> SimpleStepBuilder<I, O> chunk
(int chunkSize, org.springframework.transaction.PlatformTransactionManager transactionManager) Build a step that processes items in chunks with the size provided.<I,
O> SimpleStepBuilder<I, O> chunk
(CompletionPolicy completionPolicy) Deprecated, for removal: This API element is subject to removal in a future version.<I,
O> SimpleStepBuilder<I, O> chunk
(CompletionPolicy completionPolicy, org.springframework.transaction.PlatformTransactionManager transactionManager) Build a step that processes items in chunks with the completion policy provided.Create a new step builder that will execute a flow.Create a new step builder that will execute a job.partitioner
(String stepName, Partitioner partitioner) Create a partition step builder for a remote (or local) step.partitioner
(Step step) Create a partition step builder for a remote (or local) step.protected StepBuilder
self()
Deprecated, for removal: This API element is subject to removal in a future version.tasklet
(Tasklet tasklet, org.springframework.transaction.PlatformTransactionManager transactionManager) Build a step with a custom tasklet, not necessarily item processing.Methods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
allowStartIfComplete, enhance, getJobRepository, getName, isAllowStartIfComplete, listener, listener, meterRegistry, observationConvention, observationRegistry, repository, startLimit
-
Constructor Details
-
StepBuilder
Deprecated, for removal: This API element is subject to removal in a future version.Initialize a step builder for a step with the given name.- Parameters:
name
- the name of the step
-
StepBuilder
Initialize a step builder for a step with the given name and job repository.- Parameters:
name
- the name of the stepjobRepository
- the job repository to which the step should report to.- Since:
- 5.0
-
-
Method Details
-
tasklet
Deprecated, for removal: This API element is subject to removal in a future version.Build a step with a custom tasklet, not necessarily item processing.- Parameters:
tasklet
- a tasklet- Returns:
- a
TaskletStepBuilder
-
tasklet
public TaskletStepBuilder tasklet(Tasklet tasklet, org.springframework.transaction.PlatformTransactionManager transactionManager) Build a step with a custom tasklet, not necessarily item processing.- Parameters:
tasklet
- a tasklettransactionManager
- the transaction manager to use for the tasklet- Returns:
- a
TaskletStepBuilder
- Since:
- 5.0
-
chunk
Deprecated, for removal: This API element is subject to removal in a future version.Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, call theSimpleStepBuilder.faultTolerant()
method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) // ... etc.
- Type Parameters:
I
- the type of item to be processed as inputO
- the type of item to be output- Parameters:
chunkSize
- the chunk size (commit interval)- Returns:
- a
SimpleStepBuilder
-
chunk
public <I,O> SimpleStepBuilder<I,O> chunk(int chunkSize, org.springframework.transaction.PlatformTransactionManager transactionManager) Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, call theSimpleStepBuilder.faultTolerant()
method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.new StepBuilder("step1").<Order, Ledger> chunk(100, transactionManager).reader(new OrderReader()).writer(new LedgerWriter()) // ... etc.
- Type Parameters:
I
- the type of item to be processed as inputO
- the type of item to be output- Parameters:
chunkSize
- the chunk size (commit interval)transactionManager
- the transaction manager to use for the chunk-oriented tasklet- Returns:
- a
SimpleStepBuilder
- Since:
- 5.0
-
chunk
@Deprecated(since="5.0", forRemoval=true) public <I,O> SimpleStepBuilder<I,O> chunk(CompletionPolicy completionPolicy) Deprecated, for removal: This API element is subject to removal in a future version.Build a step that processes items in chunks with the completion policy provided. To extend the step to being fault tolerant, call theSimpleStepBuilder.faultTolerant()
method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) // ... etc.
- Type Parameters:
I
- the type of item to be processed as inputO
- the type of item to be output- Parameters:
completionPolicy
- the completion policy to use to control chunk processing- Returns:
- a
SimpleStepBuilder
-
chunk
public <I,O> SimpleStepBuilder<I,O> chunk(CompletionPolicy completionPolicy, org.springframework.transaction.PlatformTransactionManager transactionManager) Build a step that processes items in chunks with the completion policy provided. To extend the step to being fault tolerant, call theSimpleStepBuilder.faultTolerant()
method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.new StepBuilder("step1").<Order, Ledger> chunk(100, transactionManager).reader(new OrderReader()).writer(new LedgerWriter()) // ... etc.
- Type Parameters:
I
- the type of item to be processed as inputO
- the type of item to be output- Parameters:
completionPolicy
- the completion policy to use to control chunk processingtransactionManager
- the transaction manager to use for the chunk-oriented tasklet- Returns:
- a
SimpleStepBuilder
- Since:
- 5.0
-
partitioner
Create a partition step builder for a remote (or local) step.- Parameters:
stepName
- the name of the remote or delegate steppartitioner
- a partitioner to be used to construct new step executions- Returns:
- a
PartitionStepBuilder
-
partitioner
Create a partition step builder for a remote (or local) step.- Parameters:
step
- the step to execute in parallel- Returns:
- a PartitionStepBuilder
-
job
Create a new step builder that will execute a job.- Parameters:
job
- a job to execute- Returns:
- a
JobStepBuilder
-
flow
Create a new step builder that will execute a flow.- Parameters:
flow
- a flow to execute- Returns:
- a
FlowStepBuilder
-
self
- Specified by:
self
in classStepBuilderHelper<StepBuilder>
-
StepBuilder(String, JobRepository)