public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFactory implements ConfigurableTomcatWebServerFactory
ReactiveWebServerFactory that can be used to create a TomcatWebServer.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PROTOCOL
The class name of default protocol used.
|
| Constructor and Description |
|---|
TomcatReactiveWebServerFactory()
Create a new
TomcatServletWebServerFactory instance. |
TomcatReactiveWebServerFactory(int port)
Create a new
TomcatServletWebServerFactory that listens for requests using
the specified port. |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectorCustomizers(TomcatConnectorCustomizer... tomcatConnectorCustomizers)
Add
TomcatConnectorCustomizers that should be added to the Tomcat
Connector. |
void |
addContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers)
Add
TomcatContextCustomizers that should be added to the Tomcat
Context. |
void |
addContextLifecycleListeners(LifecycleListener... contextLifecycleListeners)
Add
LifecycleListeners that should be added to the Tomcat Context. |
void |
addEngineValves(Valve... engineValves)
|
protected void |
configureContext(Context context)
Configure the Tomcat
Context. |
protected void |
customizeConnector(Connector connector) |
Collection<LifecycleListener> |
getContextLifecycleListeners()
Returns a mutable collection of the
LifecycleListeners that will be applied
to the Tomcat Context. |
List<Valve> |
getEngineValves()
|
Collection<TomcatConnectorCustomizer> |
getTomcatConnectorCustomizers()
Returns a mutable collection of the
TomcatConnectorCustomizers that will be
applied to the Tomcat Connector. |
Collection<TomcatContextCustomizer> |
getTomcatContextCustomizers()
Returns a mutable collection of the
TomcatContextCustomizers that will be
applied to the Tomcat Context. |
protected TomcatWebServer |
getTomcatWebServer(Tomcat tomcat)
Factory method called to create the
TomcatWebServer. |
Charset |
getUriEncoding()
Returns the character encoding to use for URL decoding.
|
WebServer |
getWebServer(org.springframework.http.server.reactive.HttpHandler httpHandler)
Gets a new fully configured but paused
WebServer instance. |
protected void |
prepareContext(Host host,
org.springframework.http.server.reactive.TomcatHttpHandlerAdapter servlet) |
void |
setBackgroundProcessorDelay(int delay)
Sets the background processor delay in seconds.
|
void |
setBaseDirectory(File baseDirectory)
Set the Tomcat base directory.
|
void |
setContextLifecycleListeners(Collection<? extends LifecycleListener> contextLifecycleListeners)
Set
LifecycleListeners that should be applied to the Tomcat
Context. |
void |
setProtocol(String protocol)
The Tomcat protocol to use when create the
Connector. |
void |
setTomcatConnectorCustomizers(Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers)
Set
TomcatConnectorCustomizers that should be applied to the Tomcat
Connector. |
void |
setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers)
Set
TomcatContextCustomizers that should be applied to the Tomcat
Context. |
void |
setUriEncoding(Charset uriEncoding)
Set the character encoding to use for URL decoding.
|
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProviderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProvideraddErrorPagespublic static final String DEFAULT_PROTOCOL
public TomcatReactiveWebServerFactory()
TomcatServletWebServerFactory instance.public TomcatReactiveWebServerFactory(int port)
TomcatServletWebServerFactory that listens for requests using
the specified port.port - the port to listen onpublic WebServer getWebServer(org.springframework.http.server.reactive.HttpHandler httpHandler)
ReactiveWebServerFactoryWebServer 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 ReactiveWebServerFactoryhttpHandler - the HTTP handler in charge of processing requestsWebServerWebServer.stop()protected void prepareContext(Host host, org.springframework.http.server.reactive.TomcatHttpHandlerAdapter servlet)
protected void configureContext(Context context)
Context.context - the Tomcat contextprotected void customizeConnector(Connector connector)
public void setBaseDirectory(File baseDirectory)
ConfigurableTomcatWebServerFactorysetBaseDirectory in interface ConfigurableTomcatWebServerFactorybaseDirectory - the tomcat base directorypublic void setBackgroundProcessorDelay(int delay)
ConfigurableTomcatWebServerFactorysetBackgroundProcessorDelay in interface ConfigurableTomcatWebServerFactorydelay - the delay in secondspublic 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.addContextCustomizers in interface ConfigurableTomcatWebServerFactorytomcatContextCustomizers - the customizers to addpublic void setTomcatConnectorCustomizers(Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers)
TomcatConnectorCustomizers that should be applied to the Tomcat
Connector. Calling this method will replace any existing customizers.tomcatConnectorCustomizers - the customizers to setpublic void addConnectorCustomizers(TomcatConnectorCustomizer... tomcatConnectorCustomizers)
TomcatConnectorCustomizers that should be added to the Tomcat
Connector.addConnectorCustomizers in interface ConfigurableTomcatWebServerFactorytomcatConnectorCustomizers - the customizers to addpublic Collection<TomcatConnectorCustomizer> getTomcatConnectorCustomizers()
TomcatConnectorCustomizers that will be
applied to the Tomcat Connector.public void addEngineValves(Valve... engineValves)
ConfigurableTomcatWebServerFactoryaddEngineValves in interface ConfigurableTomcatWebServerFactoryengineValves - the valves to addpublic List<Valve> getEngineValves()
public void setUriEncoding(Charset uriEncoding)
setUriEncoding in interface ConfigurableTomcatWebServerFactoryuriEncoding - the uri encoding to setpublic Charset getUriEncoding()
public void setContextLifecycleListeners(Collection<? extends 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<LifecycleListener> getContextLifecycleListeners()
LifecycleListeners that will be applied
to the Tomcat Context.public void addContextLifecycleListeners(LifecycleListener... contextLifecycleListeners)
LifecycleListeners that should be added to the Tomcat Context.contextLifecycleListeners - the listeners to addprotected TomcatWebServer getTomcatWebServer(Tomcat tomcat)
TomcatWebServer. Subclasses can
override this method to return a different TomcatWebServer or apply
additional processing to the Tomcat server.tomcat - the Tomcat server.TomcatWebServer instancepublic void setProtocol(String protocol)
Connector.protocol - the protocolConnector.Connector(String)Copyright © 2019 Pivotal Software, Inc.. All rights reserved.