public class JettyEmbeddedServletContainerFactory extends AbstractEmbeddedServletContainerFactory implements org.springframework.context.ResourceLoaderAware
EmbeddedServletContainerFactory that can be used to create
JettyEmbeddedServletContainers. Can be initialized using Spring's
ServletContextInitializers or Jetty Configurations.
Unless explicitly configured otherwise this factory will created containers that listens for HTTP requests on port 8080.
AbstractEmbeddedServletContainerFactory.setPort(int),
setConfigurations(Collection),
JettyEmbeddedServletContainerlogger| Constructor and Description |
|---|
JettyEmbeddedServletContainerFactory()
Create a new
JettyEmbeddedServletContainerFactory instance. |
JettyEmbeddedServletContainerFactory(int port)
Create a new
JettyEmbeddedServletContainerFactory that listens for requests
using the specified port. |
JettyEmbeddedServletContainerFactory(String contextPath,
int port)
Create a new
JettyEmbeddedServletContainerFactory with the specified
context path and port. |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigurations(Configuration... configurations)
Add
Configurations that will be applied to the WebAppContext before
the server is started. |
Collection<Configuration> |
getConfigurations()
Returns a mutable collection of Jetty
Configurations that will be applied
to the WebAppContext before the server is created. |
EmbeddedServletContainer |
getEmbeddedServletContainer(ServletContextInitializer... initializers)
Gets a new fully configured but paused
EmbeddedServletContainer instance. |
protected JettyEmbeddedServletContainer |
getJettyEmbeddedServletContainer(Server server)
Factory method called to create the
JettyEmbeddedServletContainer. |
protected Configuration |
getServletContextInitializerConfiguration(WebAppContext webAppContext,
ServletContextInitializer... initializers)
Return a Jetty
Configuration that will invoke the specified
ServletContextInitializers. |
protected Configuration[] |
getWebAppContextConfigurations(WebAppContext webAppContext,
ServletContextInitializer... initializers)
Return the Jetty
Configurations that should be applied to the server. |
protected void |
postProcessWebAppContext(WebAppContext webAppContext)
Post process the Jetty
WebAppContext before it used with the Jetty Server. |
void |
setConfigurations(Collection<? extends Configuration> configurations)
Sets Jetty
Configurations that will be applied to the WebAppContext
before the server is created. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
addErrorPages, addInitializers, getAddress, getContextPath, getDocumentRoot, getErrorPages, getInitializers, getJspServletClassName, getMimeMappings, getPort, getSessionTimeout, getValidDocumentRoot, isRegisterDefaultServlet, isRegisterJspServlet, mergeInitializers, setAddress, setContextPath, setDocumentRoot, setErrorPages, setInitializers, setJspServletClassName, setMimeMappings, setPort, setRegisterDefaultServlet, setRegisterJspServlet, setSessionTimeout, setSessionTimeoutpublic JettyEmbeddedServletContainerFactory()
JettyEmbeddedServletContainerFactory instance.public JettyEmbeddedServletContainerFactory(int port)
JettyEmbeddedServletContainerFactory that listens for requests
using the specified port.port - the port to listen onpublic JettyEmbeddedServletContainerFactory(String contextPath, int port)
JettyEmbeddedServletContainerFactory with the specified
context path and port.contextPath - root the context pathport - the port to listen onpublic EmbeddedServletContainer getEmbeddedServletContainer(ServletContextInitializer... initializers)
EmbeddedServletContainerFactoryEmbeddedServletContainer 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 EmbeddedServletContainerFactoryinitializers - ServletContextInitializers that should be applied as
the container startsEmbeddedServletContainerEmbeddedServletContainer.stop()protected Configuration[] getWebAppContextConfigurations(WebAppContext webAppContext,
ServletContextInitializer... initializers)
Configurations that should be applied to the server.webAppContext - the Jetty WebAppContextinitializers - the ServletContextInitializers to applyprotected Configuration getServletContextInitializerConfiguration(WebAppContext webAppContext,
ServletContextInitializer... initializers)
Configuration that will invoke the specified
ServletContextInitializers. By default this method will return a
ServletContextInitializerConfiguration.webAppContext - the Jetty WebAppContextinitializers - the ServletContextInitializers to applyConfiguration instanceprotected void postProcessWebAppContext(WebAppContext webAppContext)
WebAppContext before it used with the Jetty Server.
Subclasses can override this method to apply additional processing to the
WebAppContext.webAppContext - the Jetty WebAppContextprotected JettyEmbeddedServletContainer getJettyEmbeddedServletContainer(Server server)
JettyEmbeddedServletContainer.
Subclasses can override this method to return a different
JettyEmbeddedServletContainer or apply additional processing to the Jetty
server.server - the Jetty server.JettyEmbeddedServletContainer instancepublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwarepublic void setConfigurations(Collection<? extends Configuration> configurations)
Configurations that will be applied to the WebAppContext
before the server is created. Calling this method will replace any existing
configurations.configurations - the Jetty configurations to applypublic Collection<Configuration> getConfigurations()
Configurations that will be applied
to the WebAppContext before the server is created.Configurationspublic void addConfigurations(Configuration... configurations)
Configurations that will be applied to the WebAppContext before
the server is started.configurations - the configurations to addCopyright © 2013. All rights reserved.