B
- the type of builder representedpublic abstract class AbstractTaskletStepBuilder<B extends AbstractTaskletStepBuilder<B>> extends StepBuilderHelper<AbstractTaskletStepBuilder<B>>
TaskletStep
. Handles common concerns across all tasklet
step variants, which are mostly to do with the type of tasklet they carry.StepBuilderHelper.CommonStepProperties
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<ChunkListener> |
chunkListeners |
logger, properties
Constructor and Description |
---|
AbstractTaskletStepBuilder(StepBuilderHelper<?> parent) |
Modifier and Type | Method and Description |
---|---|
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() |
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 asynchronous
taskExecutor(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.
|
allowStartIfComplete, enhance, getJobRepository, getName, getTransactionManager, isAllowStartIfComplete, listener, listener, repository, startLimit, transactionManager
protected java.util.Set<ChunkListener> chunkListeners
public AbstractTaskletStepBuilder(StepBuilderHelper<?> parent)
protected abstract Tasklet createTasklet()
public TaskletStep build()
StepBuilderHelper.enhance(Step)
and
then to createTasklet()
in subclasses to create the actual tasklet.protected void registerStepListenerAsChunkListener()
public AbstractTaskletStepBuilder<B> listener(ChunkListener listener)
listener
- the listener to registerpublic AbstractTaskletStepBuilder<B> stream(ItemStream stream)
stream
- the stream to registerpublic AbstractTaskletStepBuilder<B> taskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
taskExecutor
- the task executor to registerpublic AbstractTaskletStepBuilder<B> throttleLimit(int throttleLimit)
taskExecutor(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 allowedpublic AbstractTaskletStepBuilder<B> exceptionHandler(ExceptionHandler exceptionHandler)
exceptionHandler
- the exception handlerpublic AbstractTaskletStepBuilder<B> stepOperations(RepeatOperations repeatTemplate)
repeatTemplate
- a repeat template with rules for iteratingpublic AbstractTaskletStepBuilder<B> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
transactionAttribute
- a transaction attribute setprotected RepeatOperations getStepOperations()
protected ExceptionHandler getExceptionHandler()
protected boolean concurrent()
protected org.springframework.core.task.TaskExecutor getTaskExecutor()
protected int getThrottleLimit()
protected org.springframework.transaction.interceptor.TransactionAttribute getTransactionAttribute()
protected java.util.Set<ItemStream> getStreams()