Skip to content

Commit 55f00cf

Browse files
committed
Fix merge issue causing checkArchitectureMain failure
See gh-47750
1 parent acaa938 commit 55f00cf

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfiguration.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3737
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
3838
import org.springframework.context.annotation.Bean;
39+
import org.springframework.context.annotation.Configuration;
3940
import org.springframework.context.annotation.ImportRuntimeHints;
4041
import org.springframework.util.ClassUtils;
4142

@@ -95,14 +96,19 @@ public JvmCompilationMetrics jvmCompilationMetrics() {
9596
return new JvmCompilationMetrics();
9697
}
9798

98-
@Bean
99+
@Configuration(proxyBeanMethods = false)
99100
@ConditionalOnClass(name = VIRTUAL_THREAD_METRICS_CLASS)
100-
@ConditionalOnMissingBean(type = VIRTUAL_THREAD_METRICS_CLASS)
101-
@ImportRuntimeHints(VirtualThreadMetricsRuntimeHintsRegistrar.class)
102-
MeterBinder virtualThreadMetrics() throws ClassNotFoundException {
103-
Class<?> virtualThreadMetricsClass = ClassUtils.forName(VIRTUAL_THREAD_METRICS_CLASS,
104-
getClass().getClassLoader());
105-
return (MeterBinder) BeanUtils.instantiateClass(virtualThreadMetricsClass);
101+
static class VirtualThreadMetricsConfiguration {
102+
103+
@Bean
104+
@ConditionalOnMissingBean(type = VIRTUAL_THREAD_METRICS_CLASS)
105+
@ImportRuntimeHints(VirtualThreadMetricsRuntimeHintsRegistrar.class)
106+
MeterBinder virtualThreadMetrics() throws ClassNotFoundException {
107+
Class<?> virtualThreadMetricsClass = ClassUtils.forName(VIRTUAL_THREAD_METRICS_CLASS,
108+
getClass().getClassLoader());
109+
return (MeterBinder) BeanUtils.instantiateClass(virtualThreadMetricsClass);
110+
}
111+
106112
}
107113

108114
static final class VirtualThreadMetricsRuntimeHintsRegistrar implements RuntimeHintsRegistrar {

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

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
4343
import org.springframework.context.ApplicationContext;
4444
import org.springframework.context.annotation.Bean;
45+
import org.springframework.context.annotation.Configuration;
4546
import org.springframework.core.Ordered;
4647
import org.springframework.http.server.reactive.ContextPathCompositeHandler;
4748
import org.springframework.http.server.reactive.HttpHandler;
@@ -80,22 +81,37 @@ public HttpHandler httpHandler(ApplicationContext applicationContext, Management
8081
return httpHandler;
8182
}
8283

83-
@Bean
84+
@Configuration(proxyBeanMethods = false)
8485
@ConditionalOnClass(name = "io.undertow.Undertow")
85-
UndertowAccessLogCustomizer undertowManagementAccessLogCustomizer(ManagementServerProperties properties) {
86-
return new UndertowAccessLogCustomizer(properties);
86+
static class UndertowAccessLogCustomizerConfiguration {
87+
88+
@Bean
89+
UndertowAccessLogCustomizer undertowManagementAccessLogCustomizer(ManagementServerProperties properties) {
90+
return new UndertowAccessLogCustomizer(properties);
91+
}
92+
8793
}
8894

89-
@Bean
95+
@Configuration(proxyBeanMethods = false)
9096
@ConditionalOnClass(name = "org.apache.catalina.valves.AccessLogValve")
91-
TomcatAccessLogCustomizer tomcatManagementAccessLogCustomizer(ManagementServerProperties properties) {
92-
return new TomcatAccessLogCustomizer(properties);
97+
static class TomcatAccessLogCustomizerConfiguration {
98+
99+
@Bean
100+
TomcatAccessLogCustomizer tomcatManagementAccessLogCustomizer(ManagementServerProperties properties) {
101+
return new TomcatAccessLogCustomizer(properties);
102+
}
103+
93104
}
94105

95-
@Bean
106+
@Configuration(proxyBeanMethods = false)
96107
@ConditionalOnClass(name = "org.eclipse.jetty.server.Server")
97-
JettyAccessLogCustomizer jettyManagementAccessLogCustomizer(ManagementServerProperties properties) {
98-
return new JettyAccessLogCustomizer(properties);
108+
static class JettyAccessLogCustomizerConfiguration {
109+
110+
@Bean
111+
JettyAccessLogCustomizer jettyManagementAccessLogCustomizer(ManagementServerProperties properties) {
112+
return new JettyAccessLogCustomizer(properties);
113+
}
114+
99115
}
100116

101117
abstract static class AccessLogCustomizer implements Ordered {

0 commit comments

Comments
 (0)