Skip to content

Commit 4c9013f

Browse files
committed
Polish "Deprecate ControllerEndpointsSupplier and ExposableControllerEndpoint"
See gh-41596
1 parent e350164 commit 4c9013f

File tree

9 files changed

+26
-29
lines changed

9 files changed

+26
-29
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes;
3838
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
3939
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
40-
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
4140
import org.springframework.boot.actuate.health.HealthEndpoint;
4241
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
4342
import org.springframework.boot.actuate.info.GitInfoContributor;
@@ -110,7 +109,8 @@ public CloudFoundryInfoEndpointWebExtension cloudFoundryInfoEndpointWebExtension
110109
@SuppressWarnings("removal")
111110
public CloudFoundryWebFluxEndpointHandlerMapping cloudFoundryWebFluxEndpointHandlerMapping(
112111
ParameterValueMapper parameterMapper, EndpointMediaTypes endpointMediaTypes,
113-
WebClient.Builder webClientBuilder, ControllerEndpointsSupplier controllerEndpointsSupplier,
112+
WebClient.Builder webClientBuilder,
113+
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
114114
ApplicationContext applicationContext) {
115115
CloudFoundryWebEndpointDiscoverer endpointDiscoverer = new CloudFoundryWebEndpointDiscoverer(applicationContext,
116116
parameterMapper, endpointMediaTypes, null, Collections.emptyList(), Collections.emptyList());

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes;
3535
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
3636
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
37-
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
3837
import org.springframework.boot.actuate.health.HealthEndpoint;
3938
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
4039
import org.springframework.boot.actuate.info.GitInfoContributor;
@@ -115,7 +114,8 @@ public CloudFoundryWebEndpointServletHandlerMapping cloudFoundryWebEndpointServl
115114
ParameterValueMapper parameterMapper, EndpointMediaTypes endpointMediaTypes,
116115
RestTemplateBuilder restTemplateBuilder,
117116
org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier servletEndpointsSupplier,
118-
ControllerEndpointsSupplier controllerEndpointsSupplier, ApplicationContext applicationContext) {
117+
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
118+
ApplicationContext applicationContext) {
119119
CloudFoundryWebEndpointDiscoverer discoverer = new CloudFoundryWebEndpointDiscoverer(applicationContext,
120120
parameterMapper, endpointMediaTypes, null, Collections.emptyList(), Collections.emptyList());
121121
CloudFoundrySecurityInterceptor securityInterceptor = getSecurityInterceptor(restTemplateBuilder,

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
3434
import org.springframework.boot.actuate.endpoint.web.PathMapper;
3535
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
36-
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
37-
import org.springframework.boot.actuate.endpoint.web.annotation.ExposableControllerEndpoint;
3836
import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer;
3937
import org.springframework.boot.autoconfigure.AutoConfiguration;
4038
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -91,11 +89,11 @@ public WebEndpointDiscoverer webEndpointDiscoverer(ParameterValueMapper paramete
9189
}
9290

9391
@Bean
94-
@ConditionalOnMissingBean(ControllerEndpointsSupplier.class)
92+
@ConditionalOnMissingBean(org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier.class)
9593
@SuppressWarnings({ "deprecation", "removal" })
9694
public org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer controllerEndpointDiscoverer(
9795
ObjectProvider<PathMapper> endpointPathMappers,
98-
ObjectProvider<Collection<EndpointFilter<ExposableControllerEndpoint>>> filters) {
96+
ObjectProvider<Collection<EndpointFilter<org.springframework.boot.actuate.endpoint.web.annotation.ExposableControllerEndpoint>>> filters) {
9997
return new org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer(
10098
this.applicationContext, endpointPathMappers.orderedStream().toList(),
10199
filters.getIfAvailable(Collections::emptyList));
@@ -116,10 +114,11 @@ public IncludeExcludeEndpointFilter<ExposableWebEndpoint> webExposeExcludeProper
116114

117115
@Bean
118116
@SuppressWarnings("removal")
119-
public IncludeExcludeEndpointFilter<ExposableControllerEndpoint> controllerExposeExcludePropertyEndpointFilter() {
117+
public IncludeExcludeEndpointFilter<org.springframework.boot.actuate.endpoint.web.annotation.ExposableControllerEndpoint> controllerExposeExcludePropertyEndpointFilter() {
120118
WebEndpointProperties.Exposure exposure = this.properties.getExposure();
121-
return new IncludeExcludeEndpointFilter<>(ExposableControllerEndpoint.class, exposure.getInclude(),
122-
exposure.getExclude());
119+
return new IncludeExcludeEndpointFilter<>(
120+
org.springframework.boot.actuate.endpoint.web.annotation.ExposableControllerEndpoint.class,
121+
exposure.getInclude(), exposure.getExclude());
123122
}
124123

125124
@Configuration(proxyBeanMethods = false)

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
4747
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
4848
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
49-
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
5049
import org.springframework.boot.actuate.endpoint.web.reactive.AdditionalHealthEndpointPathsWebFluxHandlerMapping;
5150
import org.springframework.boot.actuate.endpoint.web.reactive.ControllerEndpointHandlerMapping;
5251
import org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping;
@@ -91,9 +90,9 @@ public class WebFluxEndpointManagementContextConfiguration {
9190
@ConditionalOnMissingBean
9291
@SuppressWarnings("removal")
9392
public WebFluxEndpointHandlerMapping webEndpointReactiveHandlerMapping(WebEndpointsSupplier webEndpointsSupplier,
94-
ControllerEndpointsSupplier controllerEndpointsSupplier, EndpointMediaTypes endpointMediaTypes,
95-
CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties,
96-
Environment environment) {
93+
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
94+
EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
95+
WebEndpointProperties webEndpointProperties, Environment environment) {
9796
String basePath = webEndpointProperties.getBasePath();
9897
EndpointMapping endpointMapping = new EndpointMapping(basePath);
9998
Collection<ExposableWebEndpoint> endpoints = webEndpointsSupplier.getEndpoints();
@@ -131,8 +130,8 @@ public AdditionalHealthEndpointPathsWebFluxHandlerMapping managementHealthEndpoi
131130
@ConditionalOnMissingBean
132131
@SuppressWarnings("removal")
133132
public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
134-
ControllerEndpointsSupplier controllerEndpointsSupplier, CorsEndpointProperties corsProperties,
135-
WebEndpointProperties webEndpointProperties) {
133+
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
134+
CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties) {
136135
EndpointMapping endpointMapping = new EndpointMapping(webEndpointProperties.getBasePath());
137136
return new ControllerEndpointHandlerMapping(endpointMapping, controllerEndpointsSupplier.getEndpoints(),
138137
corsProperties.toCorsConfiguration());

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
4343
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
4444
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
45-
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
4645
import org.springframework.boot.actuate.endpoint.web.servlet.AdditionalHealthEndpointPathsWebMvcHandlerMapping;
4746
import org.springframework.boot.actuate.endpoint.web.servlet.ControllerEndpointHandlerMapping;
4847
import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;
@@ -84,9 +83,9 @@ public class WebMvcEndpointManagementContextConfiguration {
8483
@SuppressWarnings("removal")
8584
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier,
8685
org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier servletEndpointsSupplier,
87-
ControllerEndpointsSupplier controllerEndpointsSupplier, EndpointMediaTypes endpointMediaTypes,
88-
CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties,
89-
Environment environment) {
86+
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
87+
EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
88+
WebEndpointProperties webEndpointProperties, Environment environment) {
9089
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
9190
Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier.getEndpoints();
9291
allEndpoints.addAll(webEndpoints);
@@ -126,8 +125,8 @@ public AdditionalHealthEndpointPathsWebMvcHandlerMapping managementHealthEndpoin
126125
@ConditionalOnMissingBean
127126
@SuppressWarnings("removal")
128127
public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
129-
ControllerEndpointsSupplier controllerEndpointsSupplier, CorsEndpointProperties corsProperties,
130-
WebEndpointProperties webEndpointProperties) {
128+
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
129+
CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties) {
131130
EndpointMapping endpointMapping = new EndpointMapping(webEndpointProperties.getBasePath());
132131
return new ControllerEndpointHandlerMapping(endpointMapping, controllerEndpointsSupplier.getEndpoints(),
133132
corsProperties.toCorsConfiguration());

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointsSupplier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
*
2424
* @author Phillip Webb
2525
* @since 2.0.0
26-
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
26+
* @deprecated since 3.3.3 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
2727
*/
2828
@FunctionalInterface
29-
@Deprecated(since = "3.3.0", forRemoval = true)
29+
@Deprecated(since = "3.3.3", forRemoval = true)
3030
@SuppressWarnings("removal")
3131
public interface ControllerEndpointsSupplier extends EndpointsSupplier<ExposableControllerEndpoint> {
3232

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ExposableControllerEndpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
*
2929
* @author Phillip Webb
3030
* @since 2.0.0
31-
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
31+
* @deprecated since 3.3.3 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
3232
*/
33-
@Deprecated(since = "3.3.0", forRemoval = true)
33+
@Deprecated(since = "3.3.3", forRemoval = true)
3434
public interface ExposableControllerEndpoint extends ExposableEndpoint<Operation>, PathMappedEndpoint {
3535

3636
/**

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* @author Phillip Webb
4747
* @author Stephane Nicoll
4848
*/
49-
@SuppressWarnings("removal")
49+
@SuppressWarnings({ "deprecation", "removal" })
5050
class ControllerEndpointHandlerMappingTests {
5151

5252
private final StaticApplicationContext context = new StaticApplicationContext();

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* @author Phillip Webb
4444
* @author Stephane Nicoll
4545
*/
46-
@SuppressWarnings("removal")
46+
@SuppressWarnings({ "deprecation", "removal" })
4747
class ControllerEndpointHandlerMappingTests {
4848

4949
private final StaticApplicationContext context = new StaticApplicationContext();

0 commit comments

Comments
 (0)