|
15 | 15 | */ |
16 | 16 | package org.springframework.batch.core.launch.support; |
17 | 17 |
|
| 18 | +import io.micrometer.core.instrument.MeterRegistry; |
| 19 | +import io.micrometer.core.instrument.Metrics; |
| 20 | + |
18 | 21 | import org.springframework.batch.core.configuration.JobRegistry; |
19 | 22 | import org.springframework.batch.core.job.Job; |
20 | 23 | import org.springframework.batch.core.job.JobExecution; |
|
29 | 32 | import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException; |
30 | 33 | import org.springframework.batch.core.repository.JobRepository; |
31 | 34 | import org.springframework.batch.core.repository.JobRestartException; |
| 35 | +import org.springframework.core.task.TaskExecutor; |
32 | 36 | import org.springframework.util.Assert; |
33 | 37 |
|
34 | 38 | /** |
@@ -64,6 +68,24 @@ public void setJobRegistry(JobRegistry jobRegistry) { |
64 | 68 | this.jobRegistry = jobRegistry; |
65 | 69 | } |
66 | 70 |
|
| 71 | + @Override |
| 72 | + public void setJobRepository(JobRepository jobRepository) { |
| 73 | + Assert.notNull(jobRepository, "JobRepository must not be null"); |
| 74 | + this.jobRepository = jobRepository; |
| 75 | + } |
| 76 | + |
| 77 | + @Override |
| 78 | + public void setTaskExecutor(TaskExecutor taskExecutor) { |
| 79 | + Assert.notNull(taskExecutor, "TaskExecutor must not be null"); |
| 80 | + this.taskExecutor = taskExecutor; |
| 81 | + } |
| 82 | + |
| 83 | + @Override |
| 84 | + public void setMeterRegistry(MeterRegistry meterRegistry) { |
| 85 | + Assert.notNull(meterRegistry, "MeterRegistry must not be null"); |
| 86 | + this.meterRegistry = meterRegistry; |
| 87 | + } |
| 88 | + |
67 | 89 | @Override |
68 | 90 | public JobExecution start(Job job, JobParameters jobParameters) |
69 | 91 | throws NoSuchJobException, JobInstanceAlreadyCompleteException, JobExecutionAlreadyRunningException, |
|
0 commit comments