public class UndertowEmbeddedServletContainerFactory extends AbstractEmbeddedServletContainerFactory implements ResourceLoaderAware
EmbeddedServletContainerFactory
that can be used to create
UndertowEmbeddedServletContainer
s.
Unless explicitly configured otherwise, the factory will create containers that listen for HTTP requests on port 8080.
UndertowEmbeddedServletContainer
logger
Constructor and Description |
---|
UndertowEmbeddedServletContainerFactory()
Create a new
UndertowEmbeddedServletContainerFactory instance. |
UndertowEmbeddedServletContainerFactory(int port)
Create a new
UndertowEmbeddedServletContainerFactory that listens for
requests using the specified port. |
UndertowEmbeddedServletContainerFactory(String contextPath,
int port)
Create a new
UndertowEmbeddedServletContainerFactory with the specified
context path and port. |
Modifier and Type | Method and Description |
---|---|
void |
addUndertowBuilderCustomizers(UndertowBuilderCustomizer... undertowBuilderCustomizers)
Add
UndertowBuilderCustomizer s that should be used to customize the
Undertow Builder . |
EmbeddedServletContainer |
getEmbeddedServletContainer(ServletContextInitializer... initializers)
Gets a new fully configured but paused
EmbeddedServletContainer instance. |
Collection<UndertowBuilderCustomizer> |
getUndertowBuilderCustomizers()
Returns a mutable collection of the
UndertowBuilderCustomizer s that will be
applied to the Undertow Builder . |
protected UndertowEmbeddedServletContainer |
getUndertowEmbeddedServletContainer(Builder builder,
DeploymentManager manager,
int port)
Factory method called to create the
UndertowEmbeddedServletContainer . |
void |
setBufferSize(Integer bufferSize) |
void |
setBuffersPerRegion(Integer buffersPerRegion) |
void |
setDirectBuffers(Boolean directBuffers) |
void |
setIoThreads(Integer ioThreads) |
void |
setRegisterJspServlet(boolean registerJspServlet)
Set if the JspServlet should be registered if it is on the classpath.
|
void |
setResourceLoader(ResourceLoader resourceLoader) |
void |
setUndertowBuilderCustomizers(Collection<? extends UndertowBuilderCustomizer> undertowBuilderCustomizers)
Set
UndertowBuilderCustomizer s that should be applied to the Undertow
Builder . |
void |
setWorkerThreads(Integer workerThreads) |
getValidDocumentRoot
addErrorPages, addInitializers, getAddress, getContextPath, getDocumentRoot, getErrorPages, getJspServletClassName, getMimeMappings, getPort, getSessionTimeout, getSsl, isRegisterDefaultServlet, isRegisterJspServlet, mergeInitializers, setAddress, setContextPath, setDocumentRoot, setErrorPages, setInitializers, setJspServletClassName, setMimeMappings, setPort, setRegisterDefaultServlet, setSessionTimeout, setSessionTimeout, setSsl
public UndertowEmbeddedServletContainerFactory()
UndertowEmbeddedServletContainerFactory
instance.public UndertowEmbeddedServletContainerFactory(int port)
UndertowEmbeddedServletContainerFactory
that listens for
requests using the specified port.port
- the port to listen onpublic UndertowEmbeddedServletContainerFactory(String contextPath, int port)
UndertowEmbeddedServletContainerFactory
with the specified
context path and port.contextPath
- root the context pathport
- the port to listen onpublic void setUndertowBuilderCustomizers(Collection<? extends UndertowBuilderCustomizer> undertowBuilderCustomizers)
UndertowBuilderCustomizer
s that should be applied to the Undertow
Builder
. Calling this method will replace any existing customizers.undertowBuilderCustomizers
- the customizers to setpublic Collection<UndertowBuilderCustomizer> getUndertowBuilderCustomizers()
UndertowBuilderCustomizer
s that will be
applied to the Undertow Builder
.public void addUndertowBuilderCustomizers(UndertowBuilderCustomizer... undertowBuilderCustomizers)
UndertowBuilderCustomizer
s that should be used to customize the
Undertow Builder
.undertowBuilderCustomizers
- the customizers to addpublic EmbeddedServletContainer getEmbeddedServletContainer(ServletContextInitializer... initializers)
EmbeddedServletContainerFactory
EmbeddedServletContainer
instance.
Clients should not be able to connect to the returned server until
EmbeddedServletContainer.start()
is called (which happens when the
ApplicationContext
has been fully refreshed).getEmbeddedServletContainer
in interface EmbeddedServletContainerFactory
initializers
- ServletContextInitializer
s that should be applied as
the container startsEmbeddedServletContainer
EmbeddedServletContainer.stop()
protected UndertowEmbeddedServletContainer getUndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, int port)
UndertowEmbeddedServletContainer
.
Subclasses can override this method to return a different
UndertowEmbeddedServletContainer
or apply additional processing to the
Builder
and DeploymentManager
used to bootstrap Undertowbuilder
- the buildermanager
- the deployment managerport
- the port that Undertow should listen onUndertowEmbeddedServletContainer
instancepublic void setResourceLoader(ResourceLoader resourceLoader)
setResourceLoader
in interface ResourceLoaderAware
public void setBufferSize(Integer bufferSize)
public void setBuffersPerRegion(Integer buffersPerRegion)
public void setIoThreads(Integer ioThreads)
public void setWorkerThreads(Integer workerThreads)
public void setDirectBuffers(Boolean directBuffers)
public void setRegisterJspServlet(boolean registerJspServlet)
ConfigurableEmbeddedServletContainer
true
so that files from the document root
will be served.setRegisterJspServlet
in interface ConfigurableEmbeddedServletContainer
setRegisterJspServlet
in class AbstractConfigurableEmbeddedServletContainer
registerJspServlet
- if the JSP servlet should be registeredCopyright © 2014 Pivotal Software, Inc.. All rights reserved.