类 AbstractTaskletStepBuilder<B extends AbstractTaskletStepBuilder<B>>
- java.lang.Object
- org.springframework.batch.core.step.builder.StepBuilderHelper<AbstractTaskletStepBuilder<B>>
- org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder<B>
- 类型参数:
B
- the type of builder represented
- 直接已知子类:
SimpleStepBuilder
,TaskletStepBuilder
public abstract class AbstractTaskletStepBuilder<B extends AbstractTaskletStepBuilder<B>> extends StepBuilderHelper<AbstractTaskletStepBuilder<B>>
Base class for step builders that want to build aTaskletStep
. Handles common concerns across all tasklet step variants, which are mostly to do with the type of tasklet they carry.- 从以下版本开始:
- 2.2
- 作者:
- Dave Syer, Michael Minella, Mahmoud Ben Hassine
嵌套类概要
从类继承的嵌套类/接口 org.springframework.batch.core.step.builder.StepBuilderHelper
StepBuilderHelper.CommonStepProperties
字段概要
字段 修饰符和类型 字段 说明 protected java.util.Set<ChunkListener>
chunkListeners
从类继承的字段 org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties
构造器概要
构造器 构造器 说明 AbstractTaskletStepBuilder(StepBuilderHelper<?> parent)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 TaskletStep
build()
Build the step from the components collected by the fluent setters.protected boolean
concurrent()
Convenience method for subclasses to determine if the step is concurrent.protected abstract Tasklet
createTasklet()
AbstractTaskletStepBuilder<B>
exceptionHandler(ExceptionHandler exceptionHandler)
Sets the exception handler to use in the case of tasklet failures.protected ExceptionHandler
getExceptionHandler()
Convenience method for subclasses to access the exception handler that was injected by user.protected RepeatOperations
getStepOperations()
Convenience method for subclasses to access the step operations that were injected by user.protected java.util.Set<ItemStream>
getStreams()
protected org.springframework.core.task.TaskExecutor
getTaskExecutor()
protected int
getThrottleLimit()
protected org.springframework.transaction.interceptor.TransactionAttribute
getTransactionAttribute()
B
listener(java.lang.Object listener)
Registers objects using the annotation based listener configuration.AbstractTaskletStepBuilder<B>
listener(ChunkListener listener)
Register a chunk listener.protected void
registerStepListenerAsChunkListener()
AbstractTaskletStepBuilder<B>
stepOperations(RepeatOperations repeatTemplate)
Sets the repeat template used for iterating the tasklet execution.AbstractTaskletStepBuilder<B>
stream(ItemStream stream)
Register a stream for callbacks that manage restart data.AbstractTaskletStepBuilder<B>
taskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Provide a task executor to use when executing the tasklet.AbstractTaskletStepBuilder<B>
throttleLimit(int throttleLimit)
In the case of an asynchronoustaskExecutor(TaskExecutor)
the number of concurrent tasklet executions can be throttled (beyond any throttling provided by a thread pool).AbstractTaskletStepBuilder<B>
transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
Sets the transaction attributes for the tasklet execution.从类继承的方法 org.springframework.batch.core.step.builder.StepBuilderHelper
allowStartIfComplete, enhance, getJobRepository, getName, getTransactionManager, isAllowStartIfComplete, listener, repository, startLimit, transactionManager
字段详细资料
chunkListeners
protected java.util.Set<ChunkListener> chunkListeners
构造器详细资料
AbstractTaskletStepBuilder
public AbstractTaskletStepBuilder(StepBuilderHelper<?> parent)
方法详细资料
createTasklet
protected abstract Tasklet createTasklet()
build
public TaskletStep build()
Build the step from the components collected by the fluent setters. Delegates first toStepBuilderHelper.enhance(Step)
and then tocreateTasklet()
in subclasses to create the actual tasklet.- 返回:
- a tasklet step fully configured and ready to execute
registerStepListenerAsChunkListener
protected void registerStepListenerAsChunkListener()
listener
public AbstractTaskletStepBuilder<B> listener(ChunkListener listener)
Register a chunk listener.- 参数:
listener
- the listener to register- 返回:
- this for fluent chaining
listener
public B listener(java.lang.Object listener)
Registers objects using the annotation based listener configuration.- 覆盖:
listener
在类中StepBuilderHelper<AbstractTaskletStepBuilder<B extends AbstractTaskletStepBuilder<B>>>
- 参数:
listener
- the object that has a method configured with listener annotation- 返回:
- this for fluent chaining
stream
public AbstractTaskletStepBuilder<B> stream(ItemStream stream)
Register a stream for callbacks that manage restart data.- 参数:
stream
- the stream to register- 返回:
- this for fluent chaining
taskExecutor
public AbstractTaskletStepBuilder<B> taskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Provide a task executor to use when executing the tasklet. Default is to use a single-threaded (synchronous) executor.- 参数:
taskExecutor
- the task executor to register- 返回:
- this for fluent chaining
throttleLimit
public AbstractTaskletStepBuilder<B> throttleLimit(int throttleLimit)
In the case of an asynchronoustaskExecutor(TaskExecutor)
the number of concurrent tasklet executions can be throttled (beyond any throttling provided by a thread pool). The throttle limit should be less than the data source pool size used in the job repository for this step.- 参数:
throttleLimit
- maximum number of concurrent tasklet executions allowed- 返回:
- this for fluent chaining
exceptionHandler
public AbstractTaskletStepBuilder<B> exceptionHandler(ExceptionHandler exceptionHandler)
Sets the exception handler to use in the case of tasklet failures. Default is to rethrow everything.- 参数:
exceptionHandler
- the exception handler- 返回:
- this for fluent chaining
stepOperations
public AbstractTaskletStepBuilder<B> stepOperations(RepeatOperations repeatTemplate)
Sets the repeat template used for iterating the tasklet execution. By default it will terminate only when the tasklet returns FINISHED (or null).- 参数:
repeatTemplate
- a repeat template with rules for iterating- 返回:
- this for fluent chaining
transactionAttribute
public AbstractTaskletStepBuilder<B> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
Sets the transaction attributes for the tasklet execution. Defaults to the default values for the transaction manager, but can be manipulated to provide longer timeouts for instance.- 参数:
transactionAttribute
- a transaction attribute set- 返回:
- this for fluent chaining
getStepOperations
protected RepeatOperations getStepOperations()
Convenience method for subclasses to access the step operations that were injected by user.- 返回:
- the repeat operations used to iterate the tasklet executions
getExceptionHandler
protected ExceptionHandler getExceptionHandler()
Convenience method for subclasses to access the exception handler that was injected by user.- 返回:
- the exception handler
concurrent
protected boolean concurrent()
Convenience method for subclasses to determine if the step is concurrent.- 返回:
- true if the tasklet is going to be run in multiple threads
getTaskExecutor
protected org.springframework.core.task.TaskExecutor getTaskExecutor()
getThrottleLimit
protected int getThrottleLimit()
getTransactionAttribute
protected org.springframework.transaction.interceptor.TransactionAttribute getTransactionAttribute()
getStreams
protected java.util.Set<ItemStream> getStreams()