|
38 | 38 | import org.springframework.batch.infrastructure.repeat.support.RepeatTemplate; |
39 | 39 | import org.springframework.batch.infrastructure.repeat.support.TaskExecutorRepeatTemplate; |
40 | 40 | import org.springframework.batch.infrastructure.support.ReflectionUtils; |
| 41 | +import org.springframework.core.task.AsyncTaskExecutor; |
41 | 42 | import org.springframework.core.task.SyncTaskExecutor; |
42 | 43 | import org.springframework.core.task.TaskExecutor; |
43 | 44 | import org.springframework.transaction.PlatformTransactionManager; |
@@ -204,7 +205,14 @@ public B stream(ItemStream stream) { |
204 | 205 | * single-threaded (synchronous) executor. |
205 | 206 | * @param taskExecutor the task executor to register |
206 | 207 | * @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. |
207 | 214 | */ |
| 215 | + @Deprecated(since = "6.0", forRemoval = true) |
208 | 216 | public B taskExecutor(TaskExecutor taskExecutor) { |
209 | 217 | this.taskExecutor = taskExecutor; |
210 | 218 | return self(); |
@@ -275,11 +283,14 @@ protected ExceptionHandler getExceptionHandler() { |
275 | 283 | /** |
276 | 284 | * Convenience method for subclasses to determine if the step is concurrent. |
277 | 285 | * @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. |
278 | 287 | */ |
| 288 | + @Deprecated(since = "6.0", forRemoval = true) |
279 | 289 | protected boolean concurrent() { |
280 | 290 | return taskExecutor != null && !(taskExecutor instanceof SyncTaskExecutor); |
281 | 291 | } |
282 | 292 |
|
| 293 | + @Deprecated(since = "6.0", forRemoval = true) |
283 | 294 | protected TaskExecutor getTaskExecutor() { |
284 | 295 | return taskExecutor; |
285 | 296 | } |
|
0 commit comments