Skip to content

Commit f9b032b

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

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/StoppableTasklet.java

+12
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
/**
@@ -28,6 +29,7 @@
2829
* so the appropriate thread safety and visibility controls should be put in place.
2930
*
3031
* @author Will Schipp
32+
* @author Hyunsang Han
3133
* @since 3.0
3234
*/
3335
public interface StoppableTasklet extends Tasklet {
@@ -38,4 +40,14 @@ public interface StoppableTasklet extends Tasklet {
3840
*/
3941
void stop();
4042

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

0 commit comments

Comments
 (0)