public class UndertowServletWebServerFactory extends AbstractServletWebServerFactory implements org.springframework.context.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.
UndertowServletWebServer
logger
Constructor and Description |
---|
UndertowServletWebServerFactory()
Create a new
UndertowServletWebServerFactory instance. |
UndertowServletWebServerFactory(int port)
Create a new
UndertowServletWebServerFactory that listens for requests
using the specified port. |
UndertowServletWebServerFactory(String contextPath,
int port)
Create a new
UndertowServletWebServerFactory with the specified context
path and port. |
Modifier and Type | Method and Description |
---|---|
void |
addBuilderCustomizers(UndertowBuilderCustomizer... customizers)
Add
UndertowBuilderCustomizer s that should be used to customize the
Undertow Undertow.Builder . |
void |
addDeploymentInfoCustomizers(UndertowDeploymentInfoCustomizer... customizers)
Add
UndertowDeploymentInfoCustomizer s that should be used to customize the
Undertow DeploymentInfo . |
String |
getAccessLogPrefix() |
Collection<UndertowBuilderCustomizer> |
getBuilderCustomizers()
Returns a mutable collection of the
UndertowBuilderCustomizer s that will be
applied to the Undertow Undertow.Builder . |
Collection<UndertowDeploymentInfoCustomizer> |
getDeploymentInfoCustomizers()
Returns a mutable collection of the
UndertowDeploymentInfoCustomizer s that
will be applied to the Undertow DeploymentInfo . |
protected UndertowServletWebServer |
getUndertowWebServer(io.undertow.Undertow.Builder builder,
io.undertow.servlet.api.DeploymentManager manager,
int port)
Factory method called to create the
UndertowServletWebServer . |
WebServer |
getWebServer(ServletContextInitializer... initializers)
Gets a new fully configured but paused
WebServer instance. |
boolean |
isAccessLogEnabled() |
boolean |
isEagerInitFilters()
Return if filters should be initialized eagerly.
|
protected boolean |
isUseForwardHeaders() |
void |
setAccessLogDirectory(File accessLogDirectory) |
void |
setAccessLogEnabled(boolean accessLogEnabled) |
void |
setAccessLogPattern(String accessLogPattern) |
void |
setAccessLogPrefix(String accessLogPrefix) |
void |
setAccessLogRotate(boolean accessLogRotate) |
void |
setAccessLogSuffix(String accessLogSuffix) |
void |
setBufferSize(Integer bufferSize) |
void |
setBuilderCustomizers(Collection<? extends UndertowBuilderCustomizer> customizers)
Set
UndertowBuilderCustomizer s that should be applied to the Undertow
Undertow.Builder . |
void |
setDeploymentInfoCustomizers(Collection<? extends UndertowDeploymentInfoCustomizer> customizers)
Set
UndertowDeploymentInfoCustomizer s that should be applied to the
Undertow DeploymentInfo . |
void |
setDirectBuffers(Boolean directBuffers) |
void |
setEagerInitFilters(boolean eagerInitFilters)
Set whether filters should be initialized eagerly.
|
void |
setIoThreads(Integer ioThreads) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
void |
setUseForwardHeaders(boolean useForwardHeaders)
Set if x-forward-* headers should be processed.
|
void |
setWorkerThreads(Integer workerThreads) |
addInitializers, getContextPath, getDisplayName, getDocumentRoot, getJsp, getLocaleCharsetMappings, getMimeMappings, getSessionStoreDir, getSessionTimeout, getUrlsOfJarsWithMetaInfResources, getValidDocumentRoot, getValidSessionStoreDir, getValidSessionStoreDir, isPersistSession, isRegisterDefaultServlet, mergeInitializers, setContextPath, setDisplayName, setDocumentRoot, setInitializers, setJsp, setLocaleCharsetMappings, setMimeMappings, setPersistSession, setRegisterDefaultServlet, setSessionStoreDir, setSessionTimeout, setSessionTimeout, shouldRegisterJspServlet
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getPort, getServerHeader, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setPort, setServerHeader, setSsl, setSslStoreProvider
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAddress, setCompression, setErrorPages, setPort, setServerHeader, setSsl, setSslStoreProvider
addErrorPages
public UndertowServletWebServerFactory()
UndertowServletWebServerFactory
instance.public UndertowServletWebServerFactory(int port)
UndertowServletWebServerFactory
that listens for requests
using the specified port.port
- the port to listen onpublic UndertowServletWebServerFactory(String contextPath, int port)
UndertowServletWebServerFactory
with the specified context
path and port.contextPath
- the root context pathport
- the port to listen onpublic void setBuilderCustomizers(Collection<? extends UndertowBuilderCustomizer> customizers)
UndertowBuilderCustomizer
s that should be applied to the Undertow
Undertow.Builder
. Calling this method will replace any existing customizers.customizers
- the customizers to setpublic Collection<UndertowBuilderCustomizer> getBuilderCustomizers()
UndertowBuilderCustomizer
s that will be
applied to the Undertow Undertow.Builder
.public void addBuilderCustomizers(UndertowBuilderCustomizer... customizers)
UndertowBuilderCustomizer
s that should be used to customize the
Undertow Undertow.Builder
.customizers
- the customizers to addpublic void setDeploymentInfoCustomizers(Collection<? extends UndertowDeploymentInfoCustomizer> customizers)
UndertowDeploymentInfoCustomizer
s that should be applied to the
Undertow DeploymentInfo
. Calling this method will replace any existing
customizers.customizers
- the customizers to setpublic Collection<UndertowDeploymentInfoCustomizer> getDeploymentInfoCustomizers()
UndertowDeploymentInfoCustomizer
s that
will be applied to the Undertow DeploymentInfo
.public void addDeploymentInfoCustomizers(UndertowDeploymentInfoCustomizer... customizers)
UndertowDeploymentInfoCustomizer
s that should be used to customize the
Undertow DeploymentInfo
.customizers
- the customizers to addpublic WebServer getWebServer(ServletContextInitializer... initializers)
ServletWebServerFactory
WebServer
instance. Clients should
not be able to connect to the returned server until WebServer.start()
is
called (which happens when the ApplicationContext
has been fully
refreshed).getWebServer
in interface ServletWebServerFactory
initializers
- ServletContextInitializer
s that should be applied as
the server startsWebServer
WebServer.stop()
protected UndertowServletWebServer getUndertowWebServer(io.undertow.Undertow.Builder builder, io.undertow.servlet.api.DeploymentManager manager, int port)
UndertowServletWebServer
. Subclasses
can override this method to return a different UndertowServletWebServer
or
apply additional processing to the Undertow.Builder
and DeploymentManager
used to bootstrap Undertowbuilder
- the buildermanager
- the deployment managerport
- the port that Undertow should listen onUndertowServletWebServer
instancepublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public void setBufferSize(Integer bufferSize)
public void setIoThreads(Integer ioThreads)
public void setWorkerThreads(Integer workerThreads)
public void setDirectBuffers(Boolean directBuffers)
public void setAccessLogDirectory(File accessLogDirectory)
public void setAccessLogPattern(String accessLogPattern)
public String getAccessLogPrefix()
public void setAccessLogPrefix(String accessLogPrefix)
public void setAccessLogSuffix(String accessLogSuffix)
public void setAccessLogEnabled(boolean accessLogEnabled)
public boolean isAccessLogEnabled()
public void setAccessLogRotate(boolean accessLogRotate)
protected final boolean isUseForwardHeaders()
public void setUseForwardHeaders(boolean useForwardHeaders)
useForwardHeaders
- if x-forward headers should be usedpublic boolean isEagerInitFilters()
true
if filters are initialized eagerly, otherwise false
.public void setEagerInitFilters(boolean eagerInitFilters)
eagerInitFilters
- true
if filters are initialized eagerly, otherwise
false
.Copyright © 2017 Pivotal Software, Inc.. All rights reserved.