2525import org .springframework .batch .core .ExitStatus ;
2626import org .springframework .batch .core .job .JobExecution ;
2727import org .springframework .batch .core .job .JobInterruptedException ;
28+ import org .springframework .batch .core .repository .JobRepository ;
2829import org .springframework .batch .core .step .StepContribution ;
2930import org .springframework .batch .core .step .StepExecution ;
3031import org .springframework .batch .core .listener .StepExecutionListener ;
31- import org .springframework .batch .core .repository .explore .JobExplorer ;
3232import org .springframework .batch .core .scope .context .ChunkContext ;
3333import org .springframework .batch .repeat .RepeatStatus ;
3434import org .springframework .beans .factory .InitializingBean ;
@@ -88,7 +88,7 @@ public class SystemCommandTasklet implements StepExecutionListener, StoppableTas
8888
8989 private volatile boolean stopped = false ;
9090
91- private JobExplorer jobExplorer ;
91+ private JobRepository jobRepository ;
9292
9393 private boolean stoppable = false ;
9494
@@ -113,7 +113,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
113113 Thread .sleep (checkInterval );// moved to the end of the logic
114114
115115 if (stoppable ) {
116- JobExecution jobExecution = jobExplorer
116+ JobExecution jobExecution = jobRepository
117117 .getJobExecution (chunkContext .getStepContext ().getStepExecution ().getJobExecutionId ());
118118
119119 if (jobExecution .isStopping ()) {
@@ -201,11 +201,11 @@ public void afterPropertiesSet() throws Exception {
201201 Assert .state (systemProcessExitCodeMapper != null , "SystemProcessExitCodeMapper must be set" );
202202 Assert .state (timeout > 0 , "timeout value must be greater than zero" );
203203 Assert .state (taskExecutor != null , "taskExecutor is required" );
204- stoppable = jobExplorer != null ;
204+ stoppable = jobRepository != null ;
205205 }
206206
207- public void setJobExplorer ( JobExplorer jobExplorer ) {
208- this .jobExplorer = jobExplorer ;
207+ public void setJobRepository ( JobRepository jobRepository ) {
208+ this .jobRepository = jobRepository ;
209209 }
210210
211211 /**
0 commit comments