public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFactory
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
TomcatConnectorCustomizer s that should be added to the Tomcat
Connector . |
void |
addContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers)
Add
TomcatContextCustomizer s that should be added to the Tomcat
Context . |
void |
addContextLifecycleListeners(LifecycleListener... contextLifecycleListeners)
Add
LifecycleListener s that should be added to the Tomcat Context . |
protected void |
configureContext(Context context)
Configure the Tomcat
Context . |
protected void |
customizeConnector(Connector connector) |
Collection<LifecycleListener> |
getContextLifecycleListeners()
Returns a mutable collection of the
LifecycleListener s that will be applied
to the Tomcat Context . |
Collection<TomcatConnectorCustomizer> |
getTomcatConnectorCustomizers()
Returns a mutable collection of the
TomcatConnectorCustomizer s that will be
applied to the Tomcat Connector . |
Collection<TomcatContextCustomizer> |
getTomcatContextCustomizers()
Returns a mutable collection of the
TomcatContextCustomizer s that will be
applied to the Tomcat Context . |
protected TomcatWebServer |
getTomcatWebServer(Tomcat tomcat)
Factory method called to create the
TomcatWebServer . |
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 |
setContextLifecycleListeners(Collection<? extends LifecycleListener> contextLifecycleListeners)
Set
LifecycleListener s 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
TomcatConnectorCustomizer s that should be applied to the Tomcat
Connector . |
void |
setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers)
Set
TomcatContextCustomizer s that should be applied to the Tomcat
Context . |
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProvider
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProvider
addErrorPages
public 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)
ReactiveWebServerFactory
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).httpHandler
- the HTTP handler in charge of processing requestsWebServer
WebServer.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 setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers)
TomcatContextCustomizer
s that should be applied to the Tomcat
Context
. Calling this method will replace any existing customizers.tomcatContextCustomizers
- the customizers to setpublic Collection<TomcatContextCustomizer> getTomcatContextCustomizers()
TomcatContextCustomizer
s that will be
applied to the Tomcat Context
.public void addContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers)
TomcatContextCustomizer
s that should be added to the Tomcat
Context
.tomcatContextCustomizers
- the customizers to addpublic void setTomcatConnectorCustomizers(Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers)
TomcatConnectorCustomizer
s 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)
TomcatConnectorCustomizer
s that should be added to the Tomcat
Connector
.tomcatConnectorCustomizers
- the customizers to addpublic Collection<TomcatConnectorCustomizer> getTomcatConnectorCustomizers()
TomcatConnectorCustomizer
s that will be
applied to the Tomcat Connector
.public void setContextLifecycleListeners(Collection<? extends LifecycleListener> contextLifecycleListeners)
LifecycleListener
s that should be applied to the Tomcat Context
. Calling this method will replace any existing listeners.contextLifecycleListeners
- the listeners to setpublic Collection<LifecycleListener> getContextLifecycleListeners()
LifecycleListener
s that will be applied
to the Tomcat Context
.public void addContextLifecycleListeners(LifecycleListener... contextLifecycleListeners)
LifecycleListener
s 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 © 2017 Pivotal Software, Inc.. All rights reserved.