|
42 | 42 | import org.springframework.boot.web.server.WebServerFactoryCustomizer; |
43 | 43 | import org.springframework.context.ApplicationContext; |
44 | 44 | import org.springframework.context.annotation.Bean; |
| 45 | +import org.springframework.context.annotation.Configuration; |
45 | 46 | import org.springframework.core.Ordered; |
46 | 47 | import org.springframework.http.server.reactive.ContextPathCompositeHandler; |
47 | 48 | import org.springframework.http.server.reactive.HttpHandler; |
@@ -80,22 +81,37 @@ public HttpHandler httpHandler(ApplicationContext applicationContext, Management |
80 | 81 | return httpHandler; |
81 | 82 | } |
82 | 83 |
|
83 | | - @Bean |
| 84 | + @Configuration(proxyBeanMethods = false) |
84 | 85 | @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 | + |
87 | 93 | } |
88 | 94 |
|
89 | | - @Bean |
| 95 | + @Configuration(proxyBeanMethods = false) |
90 | 96 | @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 | + |
93 | 104 | } |
94 | 105 |
|
95 | | - @Bean |
| 106 | + @Configuration(proxyBeanMethods = false) |
96 | 107 | @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 | + |
99 | 115 | } |
100 | 116 |
|
101 | 117 | abstract static class AccessLogCustomizer implements Ordered { |
|
0 commit comments