Skip to content

Commit cd9cc30

Browse files
committed
Repackage web server classes
Issue: 44286 Issue: 44067
1 parent 317a91f commit cd9cc30

File tree

385 files changed

+5686
-5185
lines changed

Some content is hidden

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

385 files changed

+5686
-5185
lines changed

buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationPlugin.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.List;
2525

2626
import com.tngtech.archunit.core.domain.JavaClass;
27+
import com.tngtech.archunit.core.domain.JavaModifier;
2728
import com.tngtech.archunit.lang.ArchCondition;
2829
import com.tngtech.archunit.lang.ArchRule;
2930
import com.tngtech.archunit.lang.ConditionEvents;
@@ -124,14 +125,16 @@ private void configureCheckArchitectureMain(Project project, ArchitectureCheck a
124125
.optional()
125126
.withPathSensitivity(PathSensitivity.RELATIVE);
126127
architectureCheck.getRules()
127-
.add(allClassesAnnotatedWithAutoConfigurationShouldBeListedInAutoConfigurationImports(
128+
.add(allConcreteClassesAnnotatedWithAutoConfigurationShouldBeListedInAutoConfigurationImports(
128129
autoConfigurationImports(project, resourcesDirectory)));
129130
}
130131

131-
private ArchRule allClassesAnnotatedWithAutoConfigurationShouldBeListedInAutoConfigurationImports(
132+
private ArchRule allConcreteClassesAnnotatedWithAutoConfigurationShouldBeListedInAutoConfigurationImports(
132133
Provider<AutoConfigurationImports> imports) {
133134
return ArchRuleDefinition.classes()
134135
.that()
136+
.doNotHaveModifier(JavaModifier.ABSTRACT)
137+
.and()
135138
.areAnnotatedWith("org.springframework.boot.autoconfigure.AutoConfiguration")
136139
.should(beListedInAutoConfigurationImports(imports))
137140
.allowEmptyShould(true);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/jetty/JettyAccessLogCustomizer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
import org.springframework.boot.actuate.autoconfigure.web.server.AccessLogCustomizer;
2727
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
28-
import org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory;
2928
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
29+
import org.springframework.boot.web.server.jetty.ConfigurableJettyWebServerFactory;
3030
import org.springframework.util.StringUtils;
3131

3232
/**
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,38 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.web.reactive;
17+
package org.springframework.boot.actuate.autoconfigure.web.server.jetty;
1818

19-
import reactor.core.publisher.Flux;
19+
import org.eclipse.jetty.server.Server;
2020

2121
import org.springframework.boot.WebApplicationType;
2222
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
23+
import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort;
24+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
2325
import org.springframework.boot.autoconfigure.AutoConfiguration;
24-
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2526
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2627
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2728
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
28-
import org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration;
29-
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
30-
import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory;
29+
import org.springframework.boot.autoconfigure.web.server.reactive.jetty.JettyReactiveWebServerAutoConfiguration;
30+
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
3131
import org.springframework.context.annotation.Bean;
3232

3333
/**
34-
* {@link EnableAutoConfiguration Auto-configuration} for Reactive-specific management
35-
* context concerns.
34+
* Auto-configuration for a Jetty-based reactive management context.
3635
*
37-
* @author Phillip Webb
38-
* @since 2.0.0
36+
* @author Andy Wilkinson
37+
* @since 4.0.0
3938
*/
4039
@AutoConfiguration
41-
@ConditionalOnClass(Flux.class)
40+
@ConditionalOnClass(Server.class)
4241
@ConditionalOnWebApplication(type = Type.REACTIVE)
43-
public class ReactiveManagementContextAutoConfiguration {
42+
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
43+
public class JettyReactiveManagementContextAutoConfiguration {
4444

4545
@Bean
46-
public static ManagementContextFactory reactiveWebChildContextFactory() {
46+
static ManagementContextFactory reactiveWebChildContextFactory() {
4747
return new ManagementContextFactory(WebApplicationType.REACTIVE, ReactiveWebServerFactory.class,
48-
ReactiveWebServerFactoryAutoConfiguration.class,
49-
EmbeddedWebServerFactoryCustomizerAutoConfiguration.class);
48+
JettyReactiveWebServerAutoConfiguration.class);
5049
}
5150

5251
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.actuate.autoconfigure.web.server.jetty;
18+
19+
import org.eclipse.jetty.server.Server;
20+
21+
import org.springframework.boot.WebApplicationType;
22+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
23+
import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort;
24+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
25+
import org.springframework.boot.autoconfigure.AutoConfiguration;
26+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
27+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
28+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29+
import org.springframework.boot.autoconfigure.web.server.servlet.jetty.JettyServletWebServerAutoConfiguration;
30+
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
31+
import org.springframework.context.annotation.Bean;
32+
33+
/**
34+
* Auto-configuration for a Jetty-based servlet management context.
35+
*
36+
* @author Andy Wilkinson
37+
* @since 4.0.0
38+
*/
39+
@AutoConfiguration
40+
@ConditionalOnClass(Server.class)
41+
@ConditionalOnWebApplication(type = Type.SERVLET)
42+
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
43+
public class JettyServletManagementContextAutoConfiguration {
44+
45+
@Bean
46+
static ManagementContextFactory servletWebChildContextFactory() {
47+
return new ManagementContextFactory(WebApplicationType.SERVLET, ServletWebServerFactory.class,
48+
JettyServletWebServerAutoConfiguration.class);
49+
}
50+
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.actuate.autoconfigure.web.server.netty;
18+
19+
import reactor.netty.http.server.HttpServer;
20+
21+
import org.springframework.boot.WebApplicationType;
22+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration;
23+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
24+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextType;
25+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
26+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
27+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
28+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29+
import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration;
30+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
31+
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
32+
import org.springframework.context.annotation.Bean;
33+
34+
/**
35+
* {@link ManagementContextConfiguration @ManagementContextConfiguration} for Netty-based
36+
* reactive web endpoint infrastructure when a separate management context running on a
37+
* different port is required.
38+
*
39+
* @author Andy Wilkinson
40+
*/
41+
@ConditionalOnClass(HttpServer.class)
42+
@ConditionalOnWebApplication(type = Type.REACTIVE)
43+
@EnableConfigurationProperties(ManagementServerProperties.class)
44+
@ManagementContextConfiguration(value = ManagementContextType.CHILD, proxyBeanMethods = false)
45+
class NettyReactiveManagementChildContextConfiguration {
46+
47+
@Bean
48+
static ManagementContextFactory reactiveWebChildContextFactory() {
49+
return new ManagementContextFactory(WebApplicationType.REACTIVE, ReactiveWebServerFactory.class,
50+
NettyReactiveWebServerAutoConfiguration.class);
51+
}
52+
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.actuate.autoconfigure.web.server.netty;
18+
19+
import reactor.netty.http.server.HttpServer;
20+
21+
import org.springframework.boot.WebApplicationType;
22+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
23+
import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort;
24+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
25+
import org.springframework.boot.autoconfigure.AutoConfiguration;
26+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
27+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
28+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29+
import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration;
30+
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
31+
import org.springframework.context.annotation.Bean;
32+
33+
/**
34+
* Auto-configuration for a Netty-based reactive management context.
35+
*
36+
* @author Andy Wilkinson
37+
* @since 4.0.0
38+
*/
39+
@AutoConfiguration
40+
@ConditionalOnClass(HttpServer.class)
41+
@ConditionalOnWebApplication(type = Type.REACTIVE)
42+
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
43+
public class NettyReactiveManagementContextAutoConfiguration {
44+
45+
@Bean
46+
static ManagementContextFactory reactiveWebChildContextFactory() {
47+
return new ManagementContextFactory(WebApplicationType.REACTIVE, ReactiveWebServerFactory.class,
48+
NettyReactiveWebServerAutoConfiguration.class);
49+
}
50+
51+
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/package-info.java renamed to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/package-info.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*/
1616

1717
/**
18-
* Servlet web server abstractions.
18+
* Actuator Netty web server support.
1919
*/
20-
package org.springframework.boot.web.servlet.server;
20+
package org.springframework.boot.actuate.autoconfigure.web.server.netty;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatAccessLogCustomizer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import org.springframework.boot.actuate.autoconfigure.web.server.AccessLogCustomizer;
2626
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
27-
import org.springframework.boot.web.embedded.tomcat.ConfigurableTomcatWebServerFactory;
27+
import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory;
2828

2929
/**
3030
* {@link AccessLogCustomizer} for Tomcat.

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatReactiveManagementChildContextConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
2727
import org.springframework.boot.context.properties.EnableConfigurationProperties;
28-
import org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFactory;
28+
import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory;
2929
import org.springframework.context.annotation.Bean;
3030

3131
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.actuate.autoconfigure.web.server.tomcat;
18+
19+
import org.apache.catalina.startup.Tomcat;
20+
21+
import org.springframework.boot.WebApplicationType;
22+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
23+
import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort;
24+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
25+
import org.springframework.boot.autoconfigure.AutoConfiguration;
26+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
27+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
28+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29+
import org.springframework.boot.autoconfigure.web.server.reactive.tomcat.TomcatReactiveWebServerAutoConfiguration;
30+
import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatWebServerConfiguration;
31+
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
32+
import org.springframework.context.annotation.Bean;
33+
34+
/**
35+
* Auto-configuration for a Tomcat-based reactive management context.
36+
*
37+
* @author Andy Wilkinson
38+
* @since 4.0.0
39+
*/
40+
@AutoConfiguration
41+
@ConditionalOnClass(Tomcat.class)
42+
@ConditionalOnWebApplication(type = Type.REACTIVE)
43+
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
44+
public class TomcatReactiveManagementContextAutoConfiguration {
45+
46+
@Bean
47+
static ManagementContextFactory reactiveWebChildContextFactory() {
48+
return new ManagementContextFactory(WebApplicationType.REACTIVE, ReactiveWebServerFactory.class,
49+
TomcatReactiveWebServerAutoConfiguration.class, TomcatWebServerConfiguration.class);
50+
}
51+
52+
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatServletManagementChildContextConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
2727
import org.springframework.boot.context.properties.EnableConfigurationProperties;
28-
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
28+
import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory;
2929
import org.springframework.context.annotation.Bean;
3030

3131
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.actuate.autoconfigure.web.server.tomcat;
18+
19+
import org.apache.catalina.startup.Tomcat;
20+
21+
import org.springframework.boot.WebApplicationType;
22+
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory;
23+
import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort;
24+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
25+
import org.springframework.boot.autoconfigure.AutoConfiguration;
26+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
27+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
28+
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29+
import org.springframework.boot.autoconfigure.web.server.servlet.tomcat.TomcatServletWebServerAutoConfiguration;
30+
import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatWebServerConfiguration;
31+
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
32+
import org.springframework.context.annotation.Bean;
33+
34+
/**
35+
* Auto-configuration for a Tomcat-based servlet management context.
36+
*
37+
* @author Andy Wilkinson
38+
* @since 4.0.0
39+
*/
40+
@AutoConfiguration
41+
@ConditionalOnClass(Tomcat.class)
42+
@ConditionalOnWebApplication(type = Type.SERVLET)
43+
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
44+
public class TomcatServletManagementContextAutoConfiguration {
45+
46+
@Bean
47+
static ManagementContextFactory servletWebChildContextFactory() {
48+
return new ManagementContextFactory(WebApplicationType.SERVLET, ServletWebServerFactory.class,
49+
TomcatWebServerConfiguration.class, TomcatServletWebServerAutoConfiguration.class);
50+
}
51+
52+
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/undertow/UndertowAccessLogCustomizer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import org.springframework.boot.actuate.autoconfigure.web.server.AccessLogCustomizer;
2222
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
23-
import org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory;
23+
import org.springframework.boot.web.server.undertow.ConfigurableUndertowWebServerFactory;
2424

2525
/**
2626
* {@link AccessLogCustomizer} for Undertow.

0 commit comments

Comments
 (0)