Skip to content

Commit 9f75da9

Browse files
committed
Simplify the Actuator's hypermedia support
This commit replaces the Acuator's support for hypermedia with a single endpoint that returns HAL-formatted links to all of the available endpoints. This is done without requiring Spring HATEOAS to be on the classpath in a similar manner to the existing CloudFoundry discovery endpoint. Closes gh-9901
1 parent 4a61e45 commit 9f75da9

File tree

61 files changed

+120
-2763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+120
-2763
lines changed

Diff for: spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java

-331
This file was deleted.

Diff for: spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementWebSecurityAutoConfiguration.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.springframework.boot.actuate.endpoint.Endpoint;
3030
import org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping;
3131
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
32+
import org.springframework.boot.actuate.endpoint.mvc.NamedMvcEndpoint;
3233
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
3334
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
3435
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -379,7 +380,7 @@ private EndpointHandlerMapping getRequiredEndpointHandlerMapping() {
379380
if (endpointHandlerMapping == null) {
380381
// Maybe there are actually no endpoints (e.g. management.port=-1)
381382
endpointHandlerMapping = new EndpointHandlerMapping(
382-
Collections.<MvcEndpoint>emptySet());
383+
Collections.<NamedMvcEndpoint>emptySet());
383384
}
384385
return endpointHandlerMapping;
385386
}

Diff for: spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/CloudFoundryEndpointHandlerMapping.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import org.springframework.boot.actuate.endpoint.Endpoint;
2323
import org.springframework.boot.actuate.endpoint.mvc.AbstractEndpointHandlerMapping;
24-
import org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint;
2524
import org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint;
2625
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
2726
import org.springframework.boot.actuate.endpoint.mvc.NamedMvcEndpoint;
@@ -50,10 +49,7 @@ protected void postProcessEndpoints(Set<NamedMvcEndpoint> endpoints) {
5049
HealthMvcEndpoint healthMvcEndpoint = null;
5150
while (iterator.hasNext()) {
5251
NamedMvcEndpoint endpoint = iterator.next();
53-
if (endpoint instanceof HalJsonMvcEndpoint) {
54-
iterator.remove();
55-
}
56-
else if (endpoint instanceof HealthMvcEndpoint) {
52+
if (endpoint instanceof HealthMvcEndpoint) {
5753
iterator.remove();
5854
healthMvcEndpoint = (HealthMvcEndpoint) endpoint;
5955
}

0 commit comments

Comments
 (0)