Class TaskExecutorRepeatTemplate

java.lang.Object
org.springframework.batch.repeat.support.RepeatTemplate
org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate
All Implemented Interfaces:
RepeatOperations

public class TaskExecutorRepeatTemplate extends RepeatTemplate
Provides RepeatOperations support including interceptors that can be used to modify or monitor the behaviour at run time.
This implementation is sufficient to be used to configure transactional behaviour for each item by making the RepeatCallback transactional, or for the whole batch by making the execute method transactional (but only then if the task executor is synchronous).
This class is thread-safe if its collaborators are thread-safe (interceptors, terminationPolicy, callback). Normally this will be the case, but clients need to be aware that if the task executor is asynchronous, then the other collaborators should be also. In particular the RepeatCallback that is wrapped in the execute method must be thread-safe - often it is based on some form of data source, which itself should be both thread-safe and transactional (multiple threads could be accessing it at any given time, and each thread would have its own transaction).
Author:
Dave Syer, Mahmoud Ben Hassine