|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
public class TomcatEmbeddedServletContainerFactory
EmbeddedServletContainerFactory that can be used to create
TomcatEmbeddedServletContainers. Can be initialized using Spring's
ServletContextInitializers or Tomcat LifecycleListeners.
Unless explicitly configured otherwise this factory will created containers that listens for HTTP requests on port 8080.
AbstractEmbeddedServletContainerFactory.setPort(int),
setContextLifecycleListeners(Collection),
TomcatEmbeddedServletContainer| Field Summary |
|---|
| Fields inherited from class org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory |
|---|
logger |
| Constructor Summary | |
|---|---|
TomcatEmbeddedServletContainerFactory()
Create a new TomcatEmbeddedServletContainerFactory instance. |
|
TomcatEmbeddedServletContainerFactory(int port)
Create a new TomcatEmbeddedServletContainerFactory that listens for
requests using the specified port. |
|
TomcatEmbeddedServletContainerFactory(String contextPath,
int port)
Create a new TomcatEmbeddedServletContainerFactory with the specified
context path and port. |
|
| Method Summary | |
|---|---|
void |
addContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers)
Add TomcatContextCustomizers that should be added to the Tomcat
Context. |
void |
addContextLifecycleListeners(org.apache.catalina.LifecycleListener... contextLifecycleListeners)
Add LifecycleListeners that should be added to the Tomcat Context. |
void |
addContextValves(org.apache.catalina.Valve... contextValves)
Add Valves that should be applied to the Tomcat Context. |
protected void |
configureContext(org.apache.catalina.Context context,
ServletContextInitializer[] initializers)
Configure the Tomcat Context. |
protected void |
customizeConnector(org.apache.catalina.connector.Connector connector)
|
Collection<org.apache.catalina.LifecycleListener> |
getContextLifecycleListeners()
Returns a mutable collection of the LifecycleListeners that will be applied
to the Tomcat Context . |
EmbeddedServletContainer |
getEmbeddedServletContainer(ServletContextInitializer... initializers)
Gets a new fully configured but paused EmbeddedServletContainer instance. |
Collection<TomcatContextCustomizer> |
getTomcatContextCustomizers()
Returns a mutable collection of the TomcatContextCustomizers that will be
applied to the Tomcat Context . |
protected TomcatEmbeddedServletContainer |
getTomcatEmbeddedServletContainer(org.apache.catalina.startup.Tomcat tomcat)
Factory method called to create the TomcatEmbeddedServletContainer. |
Collection<org.apache.catalina.Valve> |
getValves()
Returns a mutable collection of the Valves that will be applied to the
Tomcat Context. |
protected void |
postProcessContext(org.apache.catalina.Context context)
Post process the Tomcat Context before it used with the Tomcat Server. |
protected void |
prepareContext(org.apache.catalina.Host host,
ServletContextInitializer[] initializers)
|
void |
setBaseDirectory(File baseDirectory)
Set the Tomcat base directory. |
void |
setContextLifecycleListeners(Collection<? extends org.apache.catalina.LifecycleListener> contextLifecycleListeners)
Set LifecycleListeners that should be applied to the Tomcat Context
. |
void |
setContextValves(Collection<? extends org.apache.catalina.Valve> contextValves)
Set Valves that should be applied to the Tomcat Context. |
void |
setProtocol(String protocol)
The Tomcat protocol to use when create the Connector. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
|
void |
setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers)
Set TomcatContextCustomizers that should be applied to the Tomcat
Context . |
| Methods inherited from class org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory |
|---|
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, setSessionTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TomcatEmbeddedServletContainerFactory()
TomcatEmbeddedServletContainerFactory instance.
public TomcatEmbeddedServletContainerFactory(int port)
TomcatEmbeddedServletContainerFactory that listens for
requests using the specified port.
port - the port to listen on
public TomcatEmbeddedServletContainerFactory(String contextPath,
int port)
TomcatEmbeddedServletContainerFactory with the specified
context path and port.
contextPath - root the context pathport - the port to listen on| Method Detail |
|---|
public 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 starts
EmbeddedServletContainerEmbeddedServletContainer.stop()
protected void prepareContext(org.apache.catalina.Host host,
ServletContextInitializer[] initializers)
protected void customizeConnector(org.apache.catalina.connector.Connector connector)
protected void configureContext(org.apache.catalina.Context context,
ServletContextInitializer[] initializers)
Context.
context - the Tomcat contextinitializers - initializers to applyprotected void postProcessContext(org.apache.catalina.Context context)
Context before it used with the Tomcat Server.
Subclasses can override this method to apply additional processing to the
Context.
context - the Tomcat Contextprotected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer(org.apache.catalina.startup.Tomcat tomcat)
TomcatEmbeddedServletContainer.
Subclasses can override this method to return a different
TomcatEmbeddedServletContainer or apply additional processing to the Tomcat
server.
tomcat - the Tomcat server.
TomcatEmbeddedServletContainer instancepublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwarepublic void setBaseDirectory(File baseDirectory)
baseDirectory - the tomcat base directorypublic void setProtocol(String protocol)
Connector.
Connector.Connector(String)public void setContextValves(Collection<? extends org.apache.catalina.Valve> contextValves)
Valves that should be applied to the Tomcat Context. Calling
this method will replace any existing listeners.
contextValves - the valves to setpublic Collection<org.apache.catalina.Valve> getValves()
Valves that will be applied to the
Tomcat Context.
public void addContextValves(org.apache.catalina.Valve... contextValves)
Valves that should be applied to the Tomcat Context.
contextValves - the valves to addpublic void setContextLifecycleListeners(Collection<? extends org.apache.catalina.LifecycleListener> contextLifecycleListeners)
LifecycleListeners that should be applied to the Tomcat Context
. Calling this method will replace any existing listeners.
contextLifecycleListeners - the listeners to setpublic Collection<org.apache.catalina.LifecycleListener> getContextLifecycleListeners()
LifecycleListeners that will be applied
to the Tomcat Context .
public void addContextLifecycleListeners(org.apache.catalina.LifecycleListener... contextLifecycleListeners)
LifecycleListeners that should be added to the Tomcat Context.
contextLifecycleListeners - the listeners to addpublic void setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers)
TomcatContextCustomizers that should be applied to the Tomcat
Context . Calling this method will replace any existing customizers.
tomcatContextCustomizers - the customizers to setpublic Collection<TomcatContextCustomizer> getTomcatContextCustomizers()
TomcatContextCustomizers that will be
applied to the Tomcat Context .
public void addContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers)
TomcatContextCustomizers that should be added to the Tomcat
Context.
tomcatContextCustomizers - the customizers to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||