mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Revert DevTools polish
It seems like we can't use constructor injection at the moment.
This commit is contained in:
parent
8ded42ceb1
commit
5e50f762a3
@ -23,6 +23,7 @@ import javax.servlet.Filter;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@ -107,15 +108,11 @@ public class RemoteDevToolsAutoConfiguration {
|
||||
@ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true)
|
||||
static class RemoteRestartConfiguration {
|
||||
|
||||
private final DevToolsProperties properties;
|
||||
@Autowired
|
||||
private DevToolsProperties properties;
|
||||
|
||||
private final ServerProperties serverProperties;
|
||||
|
||||
RemoteRestartConfiguration(DevToolsProperties devToolsProperties,
|
||||
ServerProperties serverProperties) {
|
||||
this.properties = devToolsProperties;
|
||||
this.serverProperties = serverProperties;
|
||||
}
|
||||
@Autowired
|
||||
private ServerProperties serverProperties;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
|
@ -28,7 +28,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@ -75,12 +75,11 @@ public class RemoteClientConfiguration implements InitializingBean {
|
||||
|
||||
private final DevToolsProperties properties;
|
||||
|
||||
private final String remoteUrl;
|
||||
@Value("${remoteUrl}")
|
||||
private String remoteUrl;
|
||||
|
||||
public RemoteClientConfiguration(DevToolsProperties properties,
|
||||
@Value("${remoteUrl}") String remoteUrl) {
|
||||
public RemoteClientConfiguration(DevToolsProperties properties) {
|
||||
this.properties = properties;
|
||||
this.remoteUrl = remoteUrl;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ -135,25 +134,20 @@ public class RemoteClientConfiguration implements InitializingBean {
|
||||
static class LiveReloadConfiguration
|
||||
implements ApplicationListener<ClassPathChangedEvent> {
|
||||
|
||||
private final DevToolsProperties properties;
|
||||
@Autowired
|
||||
private DevToolsProperties properties;
|
||||
|
||||
private final LiveReloadServer liveReloadServer;
|
||||
@Autowired(required = false)
|
||||
private LiveReloadServer liveReloadServer;
|
||||
|
||||
private final ClientHttpRequestFactory clientHttpRequestFactory;
|
||||
@Autowired
|
||||
private ClientHttpRequestFactory clientHttpRequestFactory;
|
||||
|
||||
@Value("${remoteUrl}")
|
||||
private String remoteUrl;
|
||||
|
||||
private ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
|
||||
LiveReloadConfiguration(DevToolsProperties properties,
|
||||
ObjectProvider<LiveReloadServer> liveReloadServer,
|
||||
ClientHttpRequestFactory clientHttpRequestFactory) {
|
||||
this.properties = properties;
|
||||
this.liveReloadServer = liveReloadServer.getIfAvailable();
|
||||
this.clientHttpRequestFactory = clientHttpRequestFactory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@RestartScope
|
||||
@ConditionalOnMissingBean
|
||||
@ -187,15 +181,11 @@ public class RemoteClientConfiguration implements InitializingBean {
|
||||
@ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true)
|
||||
static class RemoteRestartClientConfiguration {
|
||||
|
||||
private final DevToolsProperties properties;
|
||||
@Autowired
|
||||
private DevToolsProperties properties;
|
||||
|
||||
private final String remoteUrl;
|
||||
|
||||
RemoteRestartClientConfiguration(DevToolsProperties properties,
|
||||
@Value("${remoteUrl}") String remoteUrl) {
|
||||
this.properties = properties;
|
||||
this.remoteUrl = remoteUrl;
|
||||
}
|
||||
@Value("${remoteUrl}")
|
||||
private String remoteUrl;
|
||||
|
||||
@Bean
|
||||
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
|
||||
|
Loading…
Reference in New Issue
Block a user