Skip to content

Commit bc160ff

Browse files
committed
Add StoppableTasklet#stop(StepExecution)
1 parent 2a223b0 commit bc160ff

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/tasklet/StoppableTasklet.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.springframework.batch.core.step.tasklet;
1717

18+
import org.springframework.batch.core.StepExecution;
1819
import org.springframework.batch.core.launch.JobOperator;
1920

2021
/**
@@ -38,4 +39,14 @@ public interface StoppableTasklet extends Tasklet {
3839
*/
3940
void stop();
4041

42+
/**
43+
* Used to signal that the job should stop, providing access to the current
44+
* {@link StepExecution} context.
45+
*
46+
* @param stepExecution the current {@link StepExecution} context in which the job
47+
* is being executed
48+
*/
49+
default void stop(StepExecution stepExecution) {
50+
stop();
51+
}
4152
}

0 commit comments

Comments
 (0)