diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
index ebce6a5877e5..174b02af599c 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2014 the original author or authors.
+ * Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,8 +51,8 @@
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
@@ -84,6 +84,7 @@
* @author Dave Syer
* @author Phillip Webb
* @author Christian Dupuis
+ * @author Andy Wilkinson
*/
@Configuration
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class })
@@ -155,14 +156,14 @@ public MvcEndpoints mvcEndpoints() {
@Bean
@ConditionalOnBean(EnvironmentEndpoint.class)
- @ConditionalOnProperty(prefix = "endpoints.env", name = "enabled", matchIfMissing = true)
+ @ConditionalOnExpression("${endpoints.env.enabled:${endpoints.enabled:true}}")
public EnvironmentMvcEndpoint environmentMvcEndpoint(EnvironmentEndpoint delegate) {
return new EnvironmentMvcEndpoint(delegate);
}
@Bean
@ConditionalOnBean(HealthEndpoint.class)
- @ConditionalOnProperty(prefix = "endpoints.health", name = "enabled", matchIfMissing = true)
+ @ConditionalOnExpression("${endpoints.health.enabled:${endpoints.enabled:true}}")
public HealthMvcEndpoint healthMvcEndpoint(HealthEndpoint delegate) {
Security security = this.managementServerProperties.getSecurity();
boolean secure = (security == null || security.isEnabled());
@@ -176,14 +177,14 @@ public HealthMvcEndpoint healthMvcEndpoint(HealthEndpoint delegate) {
@Bean
@ConditionalOnBean(MetricsEndpoint.class)
- @ConditionalOnProperty(prefix = "endpoints.metrics", name = "enabled", matchIfMissing = true)
+ @ConditionalOnExpression("${endpoints.metrics.enabled:${endpoints.enabled:true}}")
public MetricsMvcEndpoint metricsMvcEndpoint(MetricsEndpoint delegate) {
return new MetricsMvcEndpoint(delegate);
}
@Bean
@ConditionalOnBean(ShutdownEndpoint.class)
- @ConditionalOnProperty(prefix = "endpoints.shutdown", name = "enabled", matchIfMissing = true)
+ @ConditionalOnExpression("${endpoints.shutdown.enabled:false}")
public ShutdownMvcEndpoint shutdownMvcEndpoint(ShutdownEndpoint delegate) {
return new ShutdownMvcEndpoint(delegate);
}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java
index da6a6c7cedce..3cfe63c42f45 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2014 the original author or authors.
+ * Copyright 2013-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -39,8 +39,8 @@
*
*
* This configuration will get automatically enabled as soon as the Jolokia
- * {@link AgentServlet} is on the classpath. To disable set
- * endpoints.jolokia.enabled: false
.
+ * {@link AgentServlet} is on the classpath. To disable it set
+ * endpoints.jolokia.enabled: false
or endpoints.enabled: false
.
*
*
* Additional configuration parameters for Jolokia can be provided by specifying
@@ -50,11 +50,12 @@
*
* @author Christian Dupuis
* @author Dave Syer
+ * @author Andy Wilkinson
*/
@Configuration
@ConditionalOnWebApplication
@ConditionalOnClass({ AgentServlet.class })
-@ConditionalOnProperty(prefix = "endpoints.jolokia", name = "enabled", matchIfMissing = true)
+@ConditionalOnExpression("${endpoints.jolokia.enabled:${endpoints.enabled:true}}")
@AutoConfigureBefore(ManagementSecurityAutoConfiguration.class)
@AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class)
@EnableConfigurationProperties(JolokiaProperties.class)
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java
index dc70c2d09740..e6159326a206 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2014 the original author or authors.
+ * Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,14 @@
* Adapter class to expose {@link Endpoint}s as {@link MvcEndpoint}s.
*
* @author Dave Syer
+ * @author Andy Wilkinson
*/
public class EndpointMvcAdapter implements MvcEndpoint {
+ private final ResponseEntity