25
25
import org .springframework .batch .core .ExitStatus ;
26
26
import org .springframework .batch .core .job .JobExecution ;
27
27
import org .springframework .batch .core .job .JobInterruptedException ;
28
+ import org .springframework .batch .core .repository .JobRepository ;
28
29
import org .springframework .batch .core .step .StepContribution ;
29
30
import org .springframework .batch .core .step .StepExecution ;
30
31
import org .springframework .batch .core .listener .StepExecutionListener ;
31
- import org .springframework .batch .core .repository .explore .JobExplorer ;
32
32
import org .springframework .batch .core .scope .context .ChunkContext ;
33
33
import org .springframework .batch .repeat .RepeatStatus ;
34
34
import org .springframework .beans .factory .InitializingBean ;
@@ -88,7 +88,7 @@ public class SystemCommandTasklet implements StepExecutionListener, StoppableTas
88
88
89
89
private volatile boolean stopped = false ;
90
90
91
- private JobExplorer jobExplorer ;
91
+ private JobRepository jobRepository ;
92
92
93
93
private boolean stoppable = false ;
94
94
@@ -113,7 +113,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
113
113
Thread .sleep (checkInterval );// moved to the end of the logic
114
114
115
115
if (stoppable ) {
116
- JobExecution jobExecution = jobExplorer
116
+ JobExecution jobExecution = jobRepository
117
117
.getJobExecution (chunkContext .getStepContext ().getStepExecution ().getJobExecutionId ());
118
118
119
119
if (jobExecution .isStopping ()) {
@@ -201,11 +201,11 @@ public void afterPropertiesSet() throws Exception {
201
201
Assert .state (systemProcessExitCodeMapper != null , "SystemProcessExitCodeMapper must be set" );
202
202
Assert .state (timeout > 0 , "timeout value must be greater than zero" );
203
203
Assert .state (taskExecutor != null , "taskExecutor is required" );
204
- stoppable = jobExplorer != null ;
204
+ stoppable = jobRepository != null ;
205
205
}
206
206
207
- public void setJobExplorer ( JobExplorer jobExplorer ) {
208
- this .jobExplorer = jobExplorer ;
207
+ public void setJobRepository ( JobRepository jobRepository ) {
208
+ this .jobRepository = jobRepository ;
209
209
}
210
210
211
211
/**
0 commit comments