|
28 | 28 | import org.apache.commons.logging.LogFactory;
|
29 | 29 |
|
30 | 30 | import org.springframework.beans.factory.InitializingBean;
|
31 |
| -import org.springframework.beans.factory.ObjectProvider; |
| 31 | +import org.springframework.beans.factory.annotation.Autowired; |
32 | 32 | import org.springframework.beans.factory.annotation.Value;
|
33 | 33 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
34 | 34 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
@@ -75,12 +75,11 @@ public class RemoteClientConfiguration implements InitializingBean {
|
75 | 75 |
|
76 | 76 | private final DevToolsProperties properties;
|
77 | 77 |
|
78 |
| - private final String remoteUrl; |
| 78 | + @Value("${remoteUrl}") |
| 79 | + private String remoteUrl; |
79 | 80 |
|
80 |
| - public RemoteClientConfiguration(DevToolsProperties properties, |
81 |
| - @Value("${remoteUrl}") String remoteUrl) { |
| 81 | + public RemoteClientConfiguration(DevToolsProperties properties) { |
82 | 82 | this.properties = properties;
|
83 |
| - this.remoteUrl = remoteUrl; |
84 | 83 | }
|
85 | 84 |
|
86 | 85 | @Bean
|
@@ -135,25 +134,20 @@ private void logWarnings() {
|
135 | 134 | static class LiveReloadConfiguration
|
136 | 135 | implements ApplicationListener<ClassPathChangedEvent> {
|
137 | 136 |
|
138 |
| - private final DevToolsProperties properties; |
| 137 | + @Autowired |
| 138 | + private DevToolsProperties properties; |
139 | 139 |
|
140 |
| - private final LiveReloadServer liveReloadServer; |
| 140 | + @Autowired(required = false) |
| 141 | + private LiveReloadServer liveReloadServer; |
141 | 142 |
|
142 |
| - private final ClientHttpRequestFactory clientHttpRequestFactory; |
| 143 | + @Autowired |
| 144 | + private ClientHttpRequestFactory clientHttpRequestFactory; |
143 | 145 |
|
144 | 146 | @Value("${remoteUrl}")
|
145 | 147 | private String remoteUrl;
|
146 | 148 |
|
147 | 149 | private ExecutorService executor = Executors.newSingleThreadExecutor();
|
148 | 150 |
|
149 |
| - LiveReloadConfiguration(DevToolsProperties properties, |
150 |
| - ObjectProvider<LiveReloadServer> liveReloadServer, |
151 |
| - ClientHttpRequestFactory clientHttpRequestFactory) { |
152 |
| - this.properties = properties; |
153 |
| - this.liveReloadServer = liveReloadServer.getIfAvailable(); |
154 |
| - this.clientHttpRequestFactory = clientHttpRequestFactory; |
155 |
| - } |
156 |
| - |
157 | 151 | @Bean
|
158 | 152 | @RestartScope
|
159 | 153 | @ConditionalOnMissingBean
|
@@ -187,15 +181,11 @@ final ExecutorService getExecutor() {
|
187 | 181 | @ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true)
|
188 | 182 | static class RemoteRestartClientConfiguration {
|
189 | 183 |
|
190 |
| - private final DevToolsProperties properties; |
191 |
| - |
192 |
| - private final String remoteUrl; |
| 184 | + @Autowired |
| 185 | + private DevToolsProperties properties; |
193 | 186 |
|
194 |
| - RemoteRestartClientConfiguration(DevToolsProperties properties, |
195 |
| - @Value("${remoteUrl}") String remoteUrl) { |
196 |
| - this.properties = properties; |
197 |
| - this.remoteUrl = remoteUrl; |
198 |
| - } |
| 187 | + @Value("${remoteUrl}") |
| 188 | + private String remoteUrl; |
199 | 189 |
|
200 | 190 | @Bean
|
201 | 191 | public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
|
|
0 commit comments