Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
3bf5cf11
Commit
3bf5cf11
authored
Jul 18, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
Closes gh-17562
parents
a9ba7080
b725c601
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
59 deletions
+53
-59
ServletManagementChildContextConfiguration.java
...b/servlet/ServletManagementChildContextConfiguration.java
+2
-1
UndertowWebServerFactoryCustomizer.java
...gure/web/embedded/UndertowWebServerFactoryCustomizer.java
+0
-5
ReactiveWebServerFactoryConfiguration.java
...e/web/reactive/ReactiveWebServerFactoryConfiguration.java
+0
-4
UndertowServletWebServerFactoryCustomizer.java
...eb/servlet/UndertowServletWebServerFactoryCustomizer.java
+45
-0
ReactiveWebServerFactoryAutoConfigurationTests.java
...ctive/ReactiveWebServerFactoryAutoConfigurationTests.java
+0
-13
ConfigurableUndertowWebServerFactory.java
...bedded/undertow/ConfigurableUndertowWebServerFactory.java
+0
-8
UndertowReactiveWebServerFactory.java
...b/embedded/undertow/UndertowReactiveWebServerFactory.java
+1
-27
UndertowServletWebServerFactory.java
...eb/embedded/undertow/UndertowServletWebServerFactory.java
+5
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java
View file @
3bf5cf11
...
...
@@ -45,6 +45,7 @@ import org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactor
import
org.springframework.boot.autoconfigure.web.embedded.UndertowWebServerFactoryCustomizer
;
import
org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryCustomizer
;
import
org.springframework.boot.autoconfigure.web.servlet.TomcatServletWebServerFactoryCustomizer
;
import
org.springframework.boot.autoconfigure.web.servlet.UndertowServletWebServerFactoryCustomizer
;
import
org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory
;
...
...
@@ -115,7 +116,7 @@ class ServletManagementChildContextConfiguration {
ServletManagementWebServerFactoryCustomizer
(
ListableBeanFactory
beanFactory
)
{
super
(
beanFactory
,
ServletWebServerFactoryCustomizer
.
class
,
TomcatServletWebServerFactoryCustomizer
.
class
,
TomcatWebServerFactoryCustomizer
.
class
,
JettyWebServerFactoryCustomizer
.
class
,
UndertowWebServerFactoryCustomizer
.
class
);
Undertow
ServletWebServerFactoryCustomizer
.
class
,
Undertow
WebServerFactoryCustomizer
.
class
);
}
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizer.java
View file @
3bf5cf11
...
...
@@ -92,7 +92,6 @@ public class UndertowWebServerFactoryCustomizer
map
.
from
(
properties:
:
getIoThreads
).
to
(
factory:
:
setIoThreads
);
map
.
from
(
properties:
:
getWorkerThreads
).
to
(
factory:
:
setWorkerThreads
);
map
.
from
(
properties:
:
getDirectBuffers
).
to
(
factory:
:
setUseDirectBuffers
);
map
.
from
(
properties:
:
isEagerFilterInit
).
to
((
x
)
->
setEagerFilterInit
(
factory
,
x
));
map
.
from
(
properties:
:
getMaxHttpPostSize
).
as
(
DataSize:
:
toBytes
).
when
(
this
::
isPositive
)
.
to
(
options
.
server
(
UndertowOptions
.
MAX_ENTITY_SIZE
));
map
.
from
(
properties:
:
getMaxParameters
).
to
(
options
.
server
(
UndertowOptions
.
MAX_PARAMETERS
));
...
...
@@ -106,10 +105,6 @@ public class UndertowWebServerFactoryCustomizer
map
.
from
(
properties
.
getOptions
()::
getSocket
).
to
(
options
.
forEach
(
options:
:
socket
));
}
private
void
setEagerFilterInit
(
ConfigurableUndertowWebServerFactory
factory
,
Boolean
eagerFilterInit
)
{
factory
.
addDeploymentInfoCustomizers
((
deploymentInfo
)
->
deploymentInfo
.
setEagerFilterInit
(
eagerFilterInit
));
}
private
boolean
isPositive
(
Number
value
)
{
return
value
.
longValue
()
>
0
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java
View file @
3bf5cf11
...
...
@@ -34,7 +34,6 @@ import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer;
import
org.springframework.boot.web.embedded.tomcat.TomcatProtocolHandlerCustomizer
;
import
org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFactory
;
import
org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer
;
import
org.springframework.boot.web.embedded.undertow.UndertowDeploymentInfoCustomizer
;
import
org.springframework.boot.web.embedded.undertow.UndertowReactiveWebServerFactory
;
import
org.springframework.boot.web.reactive.server.ReactiveWebServerFactory
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -128,11 +127,8 @@ abstract class ReactiveWebServerFactoryConfiguration {
@Bean
UndertowReactiveWebServerFactory
undertowReactiveWebServerFactory
(
ObjectProvider
<
UndertowDeploymentInfoCustomizer
>
deploymentInfoCustomizers
,
ObjectProvider
<
UndertowBuilderCustomizer
>
builderCustomizers
)
{
UndertowReactiveWebServerFactory
factory
=
new
UndertowReactiveWebServerFactory
();
factory
.
getDeploymentInfoCustomizers
()
.
addAll
(
deploymentInfoCustomizers
.
orderedStream
().
collect
(
Collectors
.
toList
()));
factory
.
getBuilderCustomizers
().
addAll
(
builderCustomizers
.
orderedStream
().
collect
(
Collectors
.
toList
()));
return
factory
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/UndertowServletWebServerFactoryCustomizer.java
0 → 100644
View file @
3bf5cf11
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
web
.
servlet
;
import
org.springframework.boot.autoconfigure.web.ServerProperties
;
import
org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizer
;
/**
* {@link WebServerFactoryCustomizer} to apply {@link ServerProperties} to Undertow
* Servlet web servers.
*
* @author Andy Wilkinson
* @since 2.1.7
*/
public
class
UndertowServletWebServerFactoryCustomizer
implements
WebServerFactoryCustomizer
<
UndertowServletWebServerFactory
>
{
private
final
ServerProperties
serverProperties
;
public
UndertowServletWebServerFactoryCustomizer
(
ServerProperties
serverProperties
)
{
this
.
serverProperties
=
serverProperties
;
}
@Override
public
void
customize
(
UndertowServletWebServerFactory
factory
)
{
factory
.
addDeploymentInfoCustomizers
((
deploymentInfo
)
->
deploymentInfo
.
setEagerFilterInit
(
this
.
serverProperties
.
getUndertow
().
isEagerFilterInit
()));
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java
View file @
3bf5cf11
...
...
@@ -244,19 +244,6 @@ class ReactiveWebServerFactoryAutoConfigurationTests {
});
}
@Test
void
undertowDeploymentInfoCustomizerBeanIsAddedToFactory
()
{
new
ReactiveWebApplicationContextRunner
(
AnnotationConfigReactiveWebApplicationContext:
:
new
)
.
withConfiguration
(
AutoConfigurations
.
of
(
ReactiveWebServerFactoryAutoConfiguration
.
class
))
.
withClassLoader
(
new
FilteredClassLoader
(
Tomcat
.
class
,
HttpServer
.
class
,
Server
.
class
))
.
withUserConfiguration
(
UndertowDeploymentInfoCustomizerConfiguration
.
class
,
HttpHandlerConfiguration
.
class
)
.
run
((
context
)
->
{
UndertowReactiveWebServerFactory
factory
=
context
.
getBean
(
UndertowReactiveWebServerFactory
.
class
);
assertThat
(
factory
.
getDeploymentInfoCustomizers
()).
hasSize
(
1
);
});
}
@Test
void
undertowBuilderCustomizerBeanIsAddedToFactory
()
{
new
ReactiveWebApplicationContextRunner
(
AnnotationConfigReactiveWebApplicationContext:
:
new
)
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/ConfigurableUndertowWebServerFactory.java
View file @
3bf5cf11
...
...
@@ -19,7 +19,6 @@ package org.springframework.boot.web.embedded.undertow;
import
java.io.File
;
import
io.undertow.Undertow.Builder
;
import
io.undertow.servlet.api.DeploymentInfo
;
import
org.springframework.boot.web.server.ConfigurableWebServerFactory
;
...
...
@@ -40,13 +39,6 @@ public interface ConfigurableUndertowWebServerFactory extends ConfigurableWebSer
*/
void
addBuilderCustomizers
(
UndertowBuilderCustomizer
...
customizers
);
/**
* Add {@link UndertowDeploymentInfoCustomizer}s that should be used to customize the
* Undertow {@link DeploymentInfo}.
* @param customizers the customizers to add
*/
void
addDeploymentInfoCustomizers
(
UndertowDeploymentInfoCustomizer
...
customizers
);
/**
* Set the buffer size.
* @param bufferSize buffer size
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactory.java
View file @
3bf5cf11
...
...
@@ -33,7 +33,6 @@ import io.undertow.UndertowOptions;
import
io.undertow.server.HttpHandler
;
import
io.undertow.server.handlers.accesslog.AccessLogHandler
;
import
io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver
;
import
io.undertow.servlet.api.DeploymentInfo
;
import
org.xnio.OptionMap
;
import
org.xnio.Options
;
import
org.xnio.Xnio
;
...
...
@@ -56,6 +55,7 @@ public class UndertowReactiveWebServerFactory extends AbstractReactiveWebServerF
private
Set
<
UndertowBuilderCustomizer
>
builderCustomizers
=
new
LinkedHashSet
<>();
@Deprecated
private
List
<
UndertowDeploymentInfoCustomizer
>
deploymentInfoCustomizers
=
new
ArrayList
<>();
private
Integer
bufferSize
;
...
...
@@ -200,32 +200,6 @@ public class UndertowReactiveWebServerFactory extends AbstractReactiveWebServerF
return
getAddress
().
getHostAddress
();
}
/**
* Set {@link UndertowDeploymentInfoCustomizer}s that should be applied to the
* Undertow {@link DeploymentInfo}. Calling this method will replace any existing
* customizers.
* @param customizers the customizers to set
*/
public
void
setDeploymentInfoCustomizers
(
Collection
<?
extends
UndertowDeploymentInfoCustomizer
>
customizers
)
{
Assert
.
notNull
(
customizers
,
"Customizers must not be null"
);
this
.
deploymentInfoCustomizers
=
new
ArrayList
<>(
customizers
);
}
/**
* Returns a mutable collection of the {@link UndertowDeploymentInfoCustomizer}s that
* will be applied to the Undertow {@link DeploymentInfo}.
* @return the customizers that will be applied
*/
public
Collection
<
UndertowDeploymentInfoCustomizer
>
getDeploymentInfoCustomizers
()
{
return
this
.
deploymentInfoCustomizers
;
}
@Override
public
void
addDeploymentInfoCustomizers
(
UndertowDeploymentInfoCustomizer
...
customizers
)
{
Assert
.
notNull
(
customizers
,
"UndertowDeploymentInfoCustomizers must not be null"
);
this
.
deploymentInfoCustomizers
.
addAll
(
Arrays
.
asList
(
customizers
));
}
@Override
public
void
setAccessLogDirectory
(
File
accessLogDirectory
)
{
this
.
accessLogDirectory
=
accessLogDirectory
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java
View file @
3bf5cf11
...
...
@@ -196,7 +196,11 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
return
this
.
deploymentInfoCustomizers
;
}
@Override
/**
* Add {@link UndertowDeploymentInfoCustomizer}s that should be used to customize the
* Undertow {@link DeploymentInfo}.
* @param customizers the customizers to add
*/
public
void
addDeploymentInfoCustomizers
(
UndertowDeploymentInfoCustomizer
...
customizers
)
{
Assert
.
notNull
(
customizers
,
"UndertowDeploymentInfoCustomizers must not be null"
);
this
.
deploymentInfoCustomizers
.
addAll
(
Arrays
.
asList
(
customizers
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment