File tree 1 file changed +18
-0
lines changed
spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 61
61
* @author Will Schipp
62
62
* @author Mahmoud Ben Hassine
63
63
* @author Injae Kim
64
+ * @author Hyunsang Han
64
65
*/
65
66
public class SystemCommandTasklet implements StepExecutionListener , StoppableTasklet , InitializingBean {
66
67
@@ -275,4 +276,21 @@ public void stop() {
275
276
stopped = true ;
276
277
}
277
278
279
+ /**
280
+ * Interrupts the execution of the system command if the given {@link StepExecution}
281
+ * matches the current execution context. This method allows for granular control over
282
+ * stopping specific step executions, ensuring that only the intended command is halted.
283
+ *
284
+ * @param stepExecution the current {@link StepExecution} context; the execution is
285
+ * interrupted if it matches the ongoing one.
286
+ * @since 6.0
287
+ * @see StoppableTasklet#stop(StepExecution)
288
+ */
289
+ @ Override
290
+ public void stop (StepExecution stepExecution ) {
291
+ if (stepExecution .equals (execution )) {
292
+ stopped = true ;
293
+ }
294
+ }
295
+
278
296
}
You can’t perform that action at this time.
0 commit comments