|
42 | 42 | *
|
43 | 43 | * @author Dave Syer
|
44 | 44 | * @author Michael Minella
|
| 45 | + * @author Taeik Lim |
45 | 46 | * @author Mahmoud Ben Hassine
|
46 | 47 | * @since 2.2
|
47 | 48 | */
|
@@ -128,37 +129,30 @@ protected boolean isAllowStartIfComplete() {
|
128 | 129 | return properties.allowStartIfComplete != null ? properties.allowStartIfComplete : false;
|
129 | 130 | }
|
130 | 131 |
|
131 |
| - protected void enhance(Step target) { |
| 132 | + protected void enhance(AbstractStep step) { |
| 133 | + step.setJobRepository(properties.getJobRepository()); |
132 | 134 |
|
133 |
| - if (target instanceof AbstractStep) { |
134 |
| - |
135 |
| - AbstractStep step = (AbstractStep) target; |
136 |
| - step.setJobRepository(properties.getJobRepository()); |
137 |
| - |
138 |
| - ObservationRegistry observationRegistry = properties.getObservationRegistry(); |
139 |
| - if (observationRegistry != null) { |
140 |
| - step.setObservationRegistry(observationRegistry); |
141 |
| - } |
142 |
| - |
143 |
| - MeterRegistry meterRegistry = properties.getMeterRegistry(); |
144 |
| - if (meterRegistry != null) { |
145 |
| - step.setMeterRegistry(meterRegistry); |
146 |
| - } |
| 135 | + ObservationRegistry observationRegistry = properties.getObservationRegistry(); |
| 136 | + if (observationRegistry != null) { |
| 137 | + step.setObservationRegistry(observationRegistry); |
| 138 | + } |
147 | 139 |
|
148 |
| - Boolean allowStartIfComplete = properties.allowStartIfComplete; |
149 |
| - if (allowStartIfComplete != null) { |
150 |
| - step.setAllowStartIfComplete(allowStartIfComplete); |
151 |
| - } |
| 140 | + MeterRegistry meterRegistry = properties.getMeterRegistry(); |
| 141 | + if (meterRegistry != null) { |
| 142 | + step.setMeterRegistry(meterRegistry); |
| 143 | + } |
152 | 144 |
|
153 |
| - step.setStartLimit(properties.startLimit); |
| 145 | + Boolean allowStartIfComplete = properties.allowStartIfComplete; |
| 146 | + if (allowStartIfComplete != null) { |
| 147 | + step.setAllowStartIfComplete(allowStartIfComplete); |
| 148 | + } |
154 | 149 |
|
155 |
| - List<StepExecutionListener> listeners = properties.stepExecutionListeners; |
156 |
| - if (!listeners.isEmpty()) { |
157 |
| - step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0])); |
158 |
| - } |
| 150 | + step.setStartLimit(properties.startLimit); |
159 | 151 |
|
| 152 | + List<StepExecutionListener> listeners = properties.stepExecutionListeners; |
| 153 | + if (!listeners.isEmpty()) { |
| 154 | + step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0])); |
160 | 155 | }
|
161 |
| - |
162 | 156 | }
|
163 | 157 |
|
164 | 158 | public static class CommonStepProperties {
|
|
0 commit comments