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