mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-11 04:04:07 +00:00
Fix merge issue causing checkArchitectureMain failure
See gh-47750
This commit is contained in:
+13
-7
@@ -36,6 +36,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportRuntimeHints;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
@@ -95,14 +96,19 @@ public class JvmMetricsAutoConfiguration {
|
||||
return new JvmCompilationMetrics();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = VIRTUAL_THREAD_METRICS_CLASS)
|
||||
@ConditionalOnMissingBean(type = VIRTUAL_THREAD_METRICS_CLASS)
|
||||
@ImportRuntimeHints(VirtualThreadMetricsRuntimeHintsRegistrar.class)
|
||||
MeterBinder virtualThreadMetrics() throws ClassNotFoundException {
|
||||
Class<?> virtualThreadMetricsClass = ClassUtils.forName(VIRTUAL_THREAD_METRICS_CLASS,
|
||||
getClass().getClassLoader());
|
||||
return (MeterBinder) BeanUtils.instantiateClass(virtualThreadMetricsClass);
|
||||
static class VirtualThreadMetricsConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(type = VIRTUAL_THREAD_METRICS_CLASS)
|
||||
@ImportRuntimeHints(VirtualThreadMetricsRuntimeHintsRegistrar.class)
|
||||
MeterBinder virtualThreadMetrics() throws ClassNotFoundException {
|
||||
Class<?> virtualThreadMetricsClass = ClassUtils.forName(VIRTUAL_THREAD_METRICS_CLASS,
|
||||
getClass().getClassLoader());
|
||||
return (MeterBinder) BeanUtils.instantiateClass(virtualThreadMetricsClass);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static final class VirtualThreadMetricsRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
|
||||
|
||||
+25
-9
@@ -42,6 +42,7 @@ import org.springframework.boot.web.server.ConfigurableWebServerFactory;
|
||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.server.reactive.ContextPathCompositeHandler;
|
||||
import org.springframework.http.server.reactive.HttpHandler;
|
||||
@@ -80,22 +81,37 @@ public class ReactiveManagementChildContextConfiguration {
|
||||
return httpHandler;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = "io.undertow.Undertow")
|
||||
UndertowAccessLogCustomizer undertowManagementAccessLogCustomizer(ManagementServerProperties properties) {
|
||||
return new UndertowAccessLogCustomizer(properties);
|
||||
static class UndertowAccessLogCustomizerConfiguration {
|
||||
|
||||
@Bean
|
||||
UndertowAccessLogCustomizer undertowManagementAccessLogCustomizer(ManagementServerProperties properties) {
|
||||
return new UndertowAccessLogCustomizer(properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = "org.apache.catalina.valves.AccessLogValve")
|
||||
TomcatAccessLogCustomizer tomcatManagementAccessLogCustomizer(ManagementServerProperties properties) {
|
||||
return new TomcatAccessLogCustomizer(properties);
|
||||
static class TomcatAccessLogCustomizerConfiguration {
|
||||
|
||||
@Bean
|
||||
TomcatAccessLogCustomizer tomcatManagementAccessLogCustomizer(ManagementServerProperties properties) {
|
||||
return new TomcatAccessLogCustomizer(properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(name = "org.eclipse.jetty.server.Server")
|
||||
JettyAccessLogCustomizer jettyManagementAccessLogCustomizer(ManagementServerProperties properties) {
|
||||
return new JettyAccessLogCustomizer(properties);
|
||||
static class JettyAccessLogCustomizerConfiguration {
|
||||
|
||||
@Bean
|
||||
JettyAccessLogCustomizer jettyManagementAccessLogCustomizer(ManagementServerProperties properties) {
|
||||
return new JettyAccessLogCustomizer(properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
abstract static class AccessLogCustomizer implements Ordered {
|
||||
|
||||
Reference in New Issue
Block a user