类 UndertowServletWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory
org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory
- 所有已实现的接口:
Aware
,ConfigurableUndertowWebServerFactory
,ConfigurableWebServerFactory
,ErrorPageRegistry
,WebServerFactory
,ConfigurableServletWebServerFactory
,ServletWebServerFactory
,WebListenerRegistry
,ResourceLoaderAware
public class UndertowServletWebServerFactory
extends AbstractServletWebServerFactory
implements ConfigurableUndertowWebServerFactory, ResourceLoaderAware
ServletWebServerFactory
that can be used to create
UndertowServletWebServer
s.
Unless explicitly configured otherwise, the factory will create servers that listen for HTTP requests on port 8080.
- 从以下版本开始:
- 2.0.0
- 作者:
- Ivan Sopov, Andy Wilkinson, Marcos Barbero, Eddú Meléndez, Scott Frederick
- 另请参阅:
-
字段概要
从类继承的字段 org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory
logger
-
构造器概要
构造器构造器说明Create a newUndertowServletWebServerFactory
instance.UndertowServletWebServerFactory
(int port) Create a newUndertowServletWebServerFactory
that listens for requests using the specified port.UndertowServletWebServerFactory
(String contextPath, int port) Create a newUndertowServletWebServerFactory
with the specified context path and port. -
方法概要
修饰符和类型方法说明void
addBuilderCustomizers
(UndertowBuilderCustomizer... customizers) AddUndertowBuilderCustomizer
s that should be used to customize the UndertowUndertow.Builder
.void
addDeploymentInfoCustomizers
(UndertowDeploymentInfoCustomizer... customizers) AddUndertowDeploymentInfoCustomizer
s that should be used to customize the UndertowDeploymentInfo
.Returns a mutable collection of theUndertowBuilderCustomizer
s that will be applied to the UndertowUndertow.Builder
.Returns a mutable collection of theUndertowDeploymentInfoCustomizer
s that will be applied to the UndertowDeploymentInfo
.protected UndertowServletWebServer
getUndertowWebServer
(io.undertow.Undertow.Builder builder, io.undertow.servlet.api.DeploymentManager manager, int port) Factory method called to create theUndertowServletWebServer
.getWebServer
(ServletContextInitializer... initializers) Gets a new fully configured but pausedWebServer
instance.boolean
boolean
Return if filters should be eagerly initialized.boolean
Return whether the request path should be preserved on forward.protected final boolean
void
setAccessLogDirectory
(File accessLogDirectory) Set the access log directory.void
setAccessLogEnabled
(boolean accessLogEnabled) Set whether access logs are enabled.void
setAccessLogPattern
(String accessLogPattern) Set the access log pattern.void
setAccessLogPrefix
(String accessLogPrefix) Set the access log prefix.void
setAccessLogRotate
(boolean accessLogRotate) Set whether access logs rotation is enabled.void
setAccessLogSuffix
(String accessLogSuffix) Set the access log suffix.void
setBufferSize
(Integer bufferSize) Set the buffer size.void
setBuilderCustomizers
(Collection<? extends UndertowBuilderCustomizer> customizers) SetUndertowBuilderCustomizer
s that should be applied to the UndertowUndertow.Builder
.void
setDeploymentInfoCustomizers
(Collection<? extends UndertowDeploymentInfoCustomizer> customizers) SetUndertowDeploymentInfoCustomizer
s that should be applied to the UndertowDeploymentInfo
.void
setEagerFilterInit
(boolean eagerFilterInit) Set whether filters should be eagerly initialized.void
setIoThreads
(Integer ioThreads) Set the number of IO Threads.void
setPreservePathOnForward
(boolean preservePathOnForward) Set whether the request path should be preserved on forward.void
setResourceLoader
(ResourceLoader resourceLoader) void
setUseDirectBuffers
(Boolean directBuffers) Set whether direct buffers should be used.void
setUseForwardHeaders
(boolean useForwardHeaders) Set if x-forward-* headers should be processed.void
setWorkerThreads
(Integer workerThreads) Set the number of Worker Threads.从类继承的方法 org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory
addCookieSameSiteSuppliers, addInitializers, addMimeMappings, addWebListeners, getContextPath, getCookieSameSiteSuppliers, getDisplayName, getDocumentRoot, getInitParameters, getJsp, getLocaleCharsetMappings, getMimeMappings, getSession, getUrlsOfJarsWithMetaInfResources, getValidDocumentRoot, getValidSessionStoreDir, getValidSessionStoreDir, getWebListenerClassNames, isRegisterDefaultServlet, mergeInitializers, setContextPath, setCookieSameSiteSuppliers, setDisplayName, setDocumentRoot, setInitializers, setInitParameters, setJsp, setLocaleCharsetMappings, setMimeMappings, setRegisterDefaultServlet, setSession, shouldRegisterJspServlet
从类继承的方法 org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getServerNameSslBundles, getShutdown, getSsl, getSslBundle, getSslBundles, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.boot.web.server.ConfigurableWebServerFactory
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles
从接口继承的方法 org.springframework.boot.web.server.ErrorPageRegistry
addErrorPages
-
构造器详细资料
-
UndertowServletWebServerFactory
public UndertowServletWebServerFactory()Create a newUndertowServletWebServerFactory
instance. -
UndertowServletWebServerFactory
public UndertowServletWebServerFactory(int port) Create a newUndertowServletWebServerFactory
that listens for requests using the specified port.- 参数:
port
- the port to listen on
-
UndertowServletWebServerFactory
Create a newUndertowServletWebServerFactory
with the specified context path and port.- 参数:
contextPath
- the root context pathport
- the port to listen on
-
-
方法详细资料
-
setBuilderCustomizers
从接口复制的说明:ConfigurableUndertowWebServerFactory
SetUndertowBuilderCustomizer
s that should be applied to the UndertowUndertow.Builder
. Calling this method will replace any existing customizers.- 指定者:
setBuilderCustomizers
在接口中ConfigurableUndertowWebServerFactory
- 参数:
customizers
- the customizers to set
-
addBuilderCustomizers
从接口复制的说明:ConfigurableUndertowWebServerFactory
AddUndertowBuilderCustomizer
s that should be used to customize the UndertowUndertow.Builder
.- 指定者:
addBuilderCustomizers
在接口中ConfigurableUndertowWebServerFactory
- 参数:
customizers
- the customizers to add
-
getBuilderCustomizers
Returns a mutable collection of theUndertowBuilderCustomizer
s that will be applied to the UndertowUndertow.Builder
.- 返回:
- the customizers that will be applied
-
setBufferSize
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the buffer size.- 指定者:
setBufferSize
在接口中ConfigurableUndertowWebServerFactory
- 参数:
bufferSize
- buffer size
-
setIoThreads
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the number of IO Threads.- 指定者:
setIoThreads
在接口中ConfigurableUndertowWebServerFactory
- 参数:
ioThreads
- number of IO Threads
-
setWorkerThreads
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the number of Worker Threads.- 指定者:
setWorkerThreads
在接口中ConfigurableUndertowWebServerFactory
- 参数:
workerThreads
- number of Worker Threads
-
setUseDirectBuffers
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set whether direct buffers should be used.- 指定者:
setUseDirectBuffers
在接口中ConfigurableUndertowWebServerFactory
- 参数:
directBuffers
- whether direct buffers should be used
-
setAccessLogDirectory
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the access log directory.- 指定者:
setAccessLogDirectory
在接口中ConfigurableUndertowWebServerFactory
- 参数:
accessLogDirectory
- access log directory
-
setAccessLogPattern
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the access log pattern.- 指定者:
setAccessLogPattern
在接口中ConfigurableUndertowWebServerFactory
- 参数:
accessLogPattern
- access log pattern
-
setAccessLogPrefix
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the access log prefix.- 指定者:
setAccessLogPrefix
在接口中ConfigurableUndertowWebServerFactory
- 参数:
accessLogPrefix
- log prefix
-
getAccessLogPrefix
-
setAccessLogSuffix
从接口复制的说明:ConfigurableUndertowWebServerFactory
Set the access log suffix.- 指定者:
setAccessLogSuffix
在接口中ConfigurableUndertowWebServerFactory
- 参数:
accessLogSuffix
- access log suffix
-
setAccessLogEnabled
public void setAccessLogEnabled(boolean accessLogEnabled) 从接口复制的说明:ConfigurableUndertowWebServerFactory
Set whether access logs are enabled.- 指定者:
setAccessLogEnabled
在接口中ConfigurableUndertowWebServerFactory
- 参数:
accessLogEnabled
- whether access logs are enabled
-
isAccessLogEnabled
public boolean isAccessLogEnabled() -
setAccessLogRotate
public void setAccessLogRotate(boolean accessLogRotate) 从接口复制的说明:ConfigurableUndertowWebServerFactory
Set whether access logs rotation is enabled.- 指定者:
setAccessLogRotate
在接口中ConfigurableUndertowWebServerFactory
- 参数:
accessLogRotate
- whether access logs rotation is enabled
-
setUseForwardHeaders
public void setUseForwardHeaders(boolean useForwardHeaders) 从接口复制的说明:ConfigurableUndertowWebServerFactory
Set if x-forward-* headers should be processed.- 指定者:
setUseForwardHeaders
在接口中ConfigurableUndertowWebServerFactory
- 参数:
useForwardHeaders
- if x-forward headers should be used
-
isUseForwardHeaders
protected final boolean isUseForwardHeaders() -
setDeploymentInfoCustomizers
public void setDeploymentInfoCustomizers(Collection<? extends UndertowDeploymentInfoCustomizer> customizers) SetUndertowDeploymentInfoCustomizer
s that should be applied to the UndertowDeploymentInfo
. Calling this method will replace any existing customizers.- 参数:
customizers
- the customizers to set
-
addDeploymentInfoCustomizers
AddUndertowDeploymentInfoCustomizer
s that should be used to customize the UndertowDeploymentInfo
.- 参数:
customizers
- the customizers to add
-
getDeploymentInfoCustomizers
Returns a mutable collection of theUndertowDeploymentInfoCustomizer
s that will be applied to the UndertowDeploymentInfo
.- 返回:
- the customizers that will be applied
-
setResourceLoader
- 指定者:
setResourceLoader
在接口中ResourceLoaderAware
-
isEagerFilterInit
public boolean isEagerFilterInit()Return if filters should be eagerly initialized.- 返回:
true
if filters are eagerly initialized, otherwisefalse
.- 从以下版本开始:
- 2.4.0
-
setEagerFilterInit
public void setEagerFilterInit(boolean eagerFilterInit) Set whether filters should be eagerly initialized.- 参数:
eagerFilterInit
-true
if filters are eagerly initialized, otherwisefalse
.- 从以下版本开始:
- 2.4.0
-
isPreservePathOnForward
public boolean isPreservePathOnForward()Return whether the request path should be preserved on forward.- 返回:
true
if the path should be preserved when a request is forwarded, otherwisefalse
.- 从以下版本开始:
- 2.4.0
-
setPreservePathOnForward
public void setPreservePathOnForward(boolean preservePathOnForward) Set whether the request path should be preserved on forward.- 参数:
preservePathOnForward
-true
if the path should be preserved when a request is forwarded, otherwisefalse
.- 从以下版本开始:
- 2.4.0
-
getWebServer
从接口复制的说明:ServletWebServerFactory
Gets a new fully configured but pausedWebServer
instance. Clients should not be able to connect to the returned server untilWebServer.start()
is called (which happens when theApplicationContext
has been fully refreshed).- 指定者:
getWebServer
在接口中ServletWebServerFactory
- 参数:
initializers
-ServletContextInitializer
s that should be applied as the server starts- 返回:
- a fully configured and started
WebServer
- 另请参阅:
-
getUndertowWebServer
protected UndertowServletWebServer getUndertowWebServer(io.undertow.Undertow.Builder builder, io.undertow.servlet.api.DeploymentManager manager, int port) Factory method called to create theUndertowServletWebServer
. Subclasses can override this method to return a differentUndertowServletWebServer
or apply additional processing to theUndertow.Builder
andDeploymentManager
used to bootstrap Undertow- 参数:
builder
- the buildermanager
- the deployment managerport
- the port that Undertow should listen on- 返回:
- a new
UndertowServletWebServer
instance
-