|
|
|
@ -30,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
|
|
|
|
|
import org.springframework.beans.BeansException;
|
|
|
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
|
|
|
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
|
|
|
|
import org.springframework.beans.factory.SmartInitializingSingleton;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.boot.actuate.endpoint.Endpoint;
|
|
|
|
|
import org.springframework.boot.actuate.endpoint.EnvironmentEndpoint;
|
|
|
|
@ -64,7 +65,6 @@ import org.springframework.context.ConfigurableApplicationContext;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.context.event.ContextClosedEvent;
|
|
|
|
|
import org.springframework.context.event.ContextRefreshedEvent;
|
|
|
|
|
import org.springframework.core.env.ConfigurableEnvironment;
|
|
|
|
|
import org.springframework.core.env.PropertySource;
|
|
|
|
|
import org.springframework.web.context.WebApplicationContext;
|
|
|
|
@ -90,7 +90,7 @@ import org.springframework.web.servlet.DispatcherServlet;
|
|
|
|
|
ManagementServerPropertiesAutoConfiguration.class })
|
|
|
|
|
@EnableConfigurationProperties(HealthMvcEndpointProperties.class)
|
|
|
|
|
public class EndpointWebMvcAutoConfiguration implements ApplicationContextAware,
|
|
|
|
|
ApplicationListener<ContextRefreshedEvent> {
|
|
|
|
|
SmartInitializingSingleton {
|
|
|
|
|
|
|
|
|
|
private static Log logger = LogFactory.getLog(EndpointWebMvcAutoConfiguration.class);
|
|
|
|
|
|
|
|
|
@ -122,8 +122,7 @@ public class EndpointWebMvcAutoConfiguration implements ApplicationContextAware,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onApplicationEvent(ContextRefreshedEvent event) {
|
|
|
|
|
if (event.getApplicationContext() == this.applicationContext) {
|
|
|
|
|
public void afterSingletonsInstantiated() {
|
|
|
|
|
ManagementServerPort managementPort = ManagementServerPort
|
|
|
|
|
.get(this.applicationContext);
|
|
|
|
|
if (managementPort == ManagementServerPort.DIFFERENT
|
|
|
|
@ -136,7 +135,6 @@ public class EndpointWebMvcAutoConfiguration implements ApplicationContextAware,
|
|
|
|
|
.getEnvironment());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
|