Skip to content

Commit 11ec7f1

Browse files
committed
Deprecate usage of TaskExecutorRepeatTemplate in TaskletStepBuilder
Related to 52846a6
1 parent 2621b20 commit 11ec7f1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/AbstractTaskletStepBuilder.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.springframework.batch.infrastructure.repeat.support.RepeatTemplate;
3939
import org.springframework.batch.infrastructure.repeat.support.TaskExecutorRepeatTemplate;
4040
import org.springframework.batch.infrastructure.support.ReflectionUtils;
41+
import org.springframework.core.task.AsyncTaskExecutor;
4142
import org.springframework.core.task.SyncTaskExecutor;
4243
import org.springframework.core.task.TaskExecutor;
4344
import org.springframework.transaction.PlatformTransactionManager;
@@ -204,7 +205,14 @@ public B stream(ItemStream stream) {
204205
* single-threaded (synchronous) executor.
205206
* @param taskExecutor the task executor to register
206207
* @return this for fluent chaining
208+
* @deprecated Since 6.0, concurrent executions of {@link Tasklet}s with
209+
* {@link TaskExecutorRepeatTemplate} is deprecated and scheduled for removal in v7.
210+
* Concurrency support for chunk-oriented steps is provided through
211+
* {@link ChunkOrientedStepBuilder#taskExecutor(AsyncTaskExecutor)}. For simple
212+
* tasklet steps, consider using a {@link TaskExecutor} on the tasklet implementation
213+
* instead.
207214
*/
215+
@Deprecated(since = "6.0", forRemoval = true)
208216
public B taskExecutor(TaskExecutor taskExecutor) {
209217
this.taskExecutor = taskExecutor;
210218
return self();
@@ -275,11 +283,14 @@ protected ExceptionHandler getExceptionHandler() {
275283
/**
276284
* Convenience method for subclasses to determine if the step is concurrent.
277285
* @return true if the tasklet is going to be run in multiple threads
286+
* @deprecated Since 6.0 with no replacement and scheduled for removal in v7.
278287
*/
288+
@Deprecated(since = "6.0", forRemoval = true)
279289
protected boolean concurrent() {
280290
return taskExecutor != null && !(taskExecutor instanceof SyncTaskExecutor);
281291
}
282292

293+
@Deprecated(since = "6.0", forRemoval = true)
283294
protected TaskExecutor getTaskExecutor() {
284295
return taskExecutor;
285296
}

0 commit comments

Comments
 (0)