类 StepBuilder
- java.lang.Object
- org.springframework.batch.core.step.builder.StepBuilderHelper<StepBuilder>
- org.springframework.batch.core.step.builder.StepBuilder
public class StepBuilder extends StepBuilderHelper<StepBuilder>
Convenient entry point for building all kinds of steps. Use this as a factory for fluent builders of any step.- 从以下版本开始:
- 2.2
- 作者:
- Dave Syer
嵌套类概要
从类继承的嵌套类/接口 org.springframework.batch.core.step.builder.StepBuilderHelper
StepBuilderHelper.CommonStepProperties
字段概要
从类继承的字段 org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties
构造器概要
构造器 构造器 说明 StepBuilder(java.lang.String name)
Initialize a step builder for a step with the given name.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 <I,O>
SimpleStepBuilder<I,O>chunk(int chunkSize)
Build a step that processes items in chunks with the size provided.<I,O>
SimpleStepBuilder<I,O>chunk(CompletionPolicy completionPolicy)
Build a step that processes items in chunks with the completion policy provided.FlowStepBuilder
flow(Flow flow)
Create a new step builder that will execute a flow.JobStepBuilder
job(Job job)
Create a new step builder that will execute a job.PartitionStepBuilder
partitioner(java.lang.String stepName, Partitioner partitioner)
Create a partition step builder for a remote (or local) step.PartitionStepBuilder
partitioner(Step step)
Create a partition step builder for a remote (or local) step.TaskletStepBuilder
tasklet(Tasklet tasklet)
Build a step with a custom tasklet, not necessarily item processing.从类继承的方法 org.springframework.batch.core.step.builder.StepBuilderHelper
allowStartIfComplete, enhance, getJobRepository, getName, getTransactionManager, isAllowStartIfComplete, listener, listener, repository, startLimit, transactionManager
构造器详细资料
StepBuilder
public StepBuilder(java.lang.String name)
Initialize a step builder for a step with the given name.- 参数:
name
- the name of the step
方法详细资料
tasklet
public TaskletStepBuilder tasklet(Tasklet tasklet)
Build a step with a custom tasklet, not necessarily item processing.- 参数:
tasklet
- a tasklet- 返回:
- a
TaskletStepBuilder
chunk
public <I,O> SimpleStepBuilder<I,O> chunk(int chunkSize)
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.
- 类型参数:
I
- the type of item to be processed as inputO
- the type of item to be output- 参数:
chunkSize
- the chunk size (commit interval)- 返回:
- a
SimpleStepBuilder
chunk
public <I,O> SimpleStepBuilder<I,O> chunk(CompletionPolicy completionPolicy)
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.
- 类型参数:
I
- the type of item to be processed as inputO
- the type of item to be output *- 参数:
completionPolicy
- the completion policy to use to control chunk processing- 返回:
- a
SimpleStepBuilder
partitioner
public PartitionStepBuilder partitioner(java.lang.String stepName, Partitioner partitioner)
Create a partition step builder for a remote (or local) step.- 参数:
stepName
- the name of the remote or delegate steppartitioner
- a partitioner to be used to construct new step executions- 返回:
- a
PartitionStepBuilder
partitioner
public PartitionStepBuilder partitioner(Step step)
Create a partition step builder for a remote (or local) step.- 参数:
step
- the step to execute in parallel- 返回:
- a PartitionStepBuilder
job
public JobStepBuilder job(Job job)
Create a new step builder that will execute a job.- 参数:
job
- a job to execute- 返回:
- a
JobStepBuilder
flow
public FlowStepBuilder flow(Flow flow)
Create a new step builder that will execute a flow.- 参数:
flow
- a flow to execute- 返回:
- a
FlowStepBuilder