|
|
|
@ -19,9 +19,9 @@ package org.springframework.bootstrap.actuate.autoconfigure;
|
|
|
|
|
import javax.servlet.Servlet;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.bootstrap.actuate.health.HealthIndicator;
|
|
|
|
|
import org.springframework.bootstrap.actuate.health.HealthzEndpoint;
|
|
|
|
|
import org.springframework.bootstrap.actuate.health.VanillaHealthIndicator;
|
|
|
|
|
import org.springframework.bootstrap.actuate.endpoint.health.HealthEndpoint;
|
|
|
|
|
import org.springframework.bootstrap.actuate.endpoint.health.HealthIndicator;
|
|
|
|
|
import org.springframework.bootstrap.actuate.endpoint.health.VanillaHealthIndicator;
|
|
|
|
|
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
|
|
|
|
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
|
|
|
|
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
|
|
|
@ -30,21 +30,21 @@ import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.web.servlet.DispatcherServlet;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@link EnableAutoConfiguration Auto-configuration} for /healthz endpoint.
|
|
|
|
|
* {@link EnableAutoConfiguration Auto-configuration} for /health endpoint.
|
|
|
|
|
*
|
|
|
|
|
* @author Dave Syer
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class })
|
|
|
|
|
@ConditionalOnMissingBean({ HealthzEndpoint.class })
|
|
|
|
|
public class HealthzConfiguration {
|
|
|
|
|
@ConditionalOnMissingBean({ HealthEndpoint.class })
|
|
|
|
|
public class HealthConfiguration {
|
|
|
|
|
|
|
|
|
|
@Autowired(required = false)
|
|
|
|
|
private HealthIndicator<? extends Object> healthIndicator = new VanillaHealthIndicator();
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public HealthzEndpoint<? extends Object> healthzEndpoint() {
|
|
|
|
|
return new HealthzEndpoint<Object>(healthIndicator);
|
|
|
|
|
public HealthEndpoint<? extends Object> healthzEndpoint() {
|
|
|
|
|
return new HealthEndpoint<Object>(this.healthIndicator);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|