类 TomcatReactiveWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
org.springframework.boot.web.reactive.server.AbstractReactiveWebServerFactory
org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFactory
- 所有已实现的接口:
ConfigurableTomcatWebServerFactory,ConfigurableReactiveWebServerFactory,ReactiveWebServerFactory,ConfigurableWebServerFactory,ErrorPageRegistry,WebServerFactory
public class TomcatReactiveWebServerFactory
extends AbstractReactiveWebServerFactory
implements ConfigurableTomcatWebServerFactory
ReactiveWebServerFactory that can be used to create a TomcatWebServer.- 从以下版本开始:
- 2.0.0
- 作者:
- Brian Clozel, HaiTao Zhang, Moritz Halbritter, Scott Frederick
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a newTomcatReactiveWebServerFactoryinstance.TomcatReactiveWebServerFactory(int port) Create a newTomcatReactiveWebServerFactorythat listens for requests using the specified port. -
方法概要
修饰符和类型方法说明voidaddAdditionalTomcatConnectors(Connector... connectors) AddConnectors in addition to the default connector, e.g. for SSL or AJP.voidaddConnectorCustomizers(TomcatConnectorCustomizer... tomcatConnectorCustomizers) AddTomcatConnectorCustomizers that should be added to the TomcatConnector.voidaddContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers) AddTomcatContextCustomizers that should be added to the TomcatContext.voidaddContextLifecycleListeners(LifecycleListener... contextLifecycleListeners) AddLifecycleListeners that should be added to the TomcatContext.voidaddEngineValves(Valve... engineValves) voidaddProtocolHandlerCustomizers(TomcatProtocolHandlerCustomizer<?>... tomcatProtocolHandlerCustomizers) AddTomcatProtocolHandlerCustomizers that should be added to the TomcatConnector.protected voidconfigureContext(Context context) Configure the TomcatContext.protected voidcustomizeConnector(Connector connector) Returns a mutable collection of theConnectors that will be added to the Tomcat.Returns a mutable collection of theLifecycleListeners that will be applied to the TomcatContext.Returns a mutable collection of theTomcatConnectorCustomizers that will be applied to the TomcatConnector.Returns a mutable collection of theTomcatContextCustomizers that will be applied to the TomcatContext.Returns a mutable collection of theTomcatProtocolHandlerCustomizers that will be applied to the TomcatConnector.protected TomcatWebServergetTomcatWebServer(Tomcat tomcat) Factory method called to create theTomcatWebServer.Returns the character encoding to use for URL decoding.getWebServer(HttpHandler httpHandler) Gets a new fully configured but pausedWebServerinstance.protected voidprepareContext(Host host, TomcatHttpHandlerAdapter servlet) voidsetBackgroundProcessorDelay(int delay) Sets the background processor delay in seconds.voidsetBaseDirectory(File baseDirectory) Set the Tomcat base directory.voidsetContextLifecycleListeners(Collection<? extends LifecycleListener> contextLifecycleListeners) SetLifecycleListeners that should be applied to the TomcatContext.voidsetDisableMBeanRegistry(boolean disableMBeanRegistry) Set whether the factory should disable Tomcat's MBean registry prior to creating the server.voidsetProtocol(String protocol) The Tomcat protocol to use when create theConnector.voidsetTomcatConnectorCustomizers(Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers) SetTomcatConnectorCustomizers that should be applied to the TomcatConnector.voidsetTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers) SetTomcatContextCustomizers that should be applied to the TomcatContext.voidsetTomcatProtocolHandlerCustomizers(Collection<? extends TomcatProtocolHandlerCustomizer<?>> tomcatProtocolHandlerCustomizers) SetTomcatProtocolHandlerCustomizers that should be applied to the TomcatConnector.voidsetUriEncoding(Charset uriEncoding) Set the character encoding to use for URL decoding.voidsetUseApr(boolean useApr) Whether to use APR.从类继承的方法 org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getServerNameSslBundles, getShutdown, getSsl, getSslBundle, getSslBundles, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.springframework.boot.web.server.ConfigurableWebServerFactory
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundles从接口继承的方法 org.springframework.boot.web.server.ErrorPageRegistry
addErrorPages
-
字段详细资料
-
DEFAULT_PROTOCOL
The class name of default protocol used.- 另请参阅:
-
-
构造器详细资料
-
TomcatReactiveWebServerFactory
public TomcatReactiveWebServerFactory()Create a newTomcatReactiveWebServerFactoryinstance. -
TomcatReactiveWebServerFactory
public TomcatReactiveWebServerFactory(int port) Create a newTomcatReactiveWebServerFactorythat listens for requests using the specified port.- 参数:
port- the port to listen on
-
-
方法详细资料
-
getWebServer
从接口复制的说明:ReactiveWebServerFactoryGets a new fully configured but pausedWebServerinstance. Clients should not be able to connect to the returned server untilWebServer.start()is called (which happens when theApplicationContexthas been fully refreshed).- 指定者:
getWebServer在接口中ReactiveWebServerFactory- 参数:
httpHandler- the HTTP handler in charge of processing requests- 返回:
- a fully configured and started
WebServer - 另请参阅:
-
prepareContext
-
configureContext
Configure the TomcatContext.- 参数:
context- the Tomcat context
-
customizeConnector
-
setBaseDirectory
从接口复制的说明:ConfigurableTomcatWebServerFactorySet the Tomcat base directory. If not specified a temporary directory will be used.- 指定者:
setBaseDirectory在接口中ConfigurableTomcatWebServerFactory- 参数:
baseDirectory- the tomcat base directory
-
setBackgroundProcessorDelay
public void setBackgroundProcessorDelay(int delay) 从接口复制的说明:ConfigurableTomcatWebServerFactorySets the background processor delay in seconds.- 指定者:
setBackgroundProcessorDelay在接口中ConfigurableTomcatWebServerFactory- 参数:
delay- the delay in seconds
-
setTomcatContextCustomizers
public void setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers) SetTomcatContextCustomizers that should be applied to the TomcatContext. Calling this method will replace any existing customizers.- 参数:
tomcatContextCustomizers- the customizers to set
-
getTomcatContextCustomizers
Returns a mutable collection of theTomcatContextCustomizers that will be applied to the TomcatContext.- 返回:
- the listeners that will be applied
-
addContextCustomizers
AddTomcatContextCustomizers that should be added to the TomcatContext.- 指定者:
addContextCustomizers在接口中ConfigurableTomcatWebServerFactory- 参数:
tomcatContextCustomizers- the customizers to add
-
setTomcatConnectorCustomizers
public void setTomcatConnectorCustomizers(Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers) SetTomcatConnectorCustomizers that should be applied to the TomcatConnector. Calling this method will replace any existing customizers.- 参数:
tomcatConnectorCustomizers- the customizers to set
-
addConnectorCustomizers
AddTomcatConnectorCustomizers that should be added to the TomcatConnector.- 指定者:
addConnectorCustomizers在接口中ConfigurableTomcatWebServerFactory- 参数:
tomcatConnectorCustomizers- the customizers to add
-
getTomcatConnectorCustomizers
Returns a mutable collection of theTomcatConnectorCustomizers that will be applied to the TomcatConnector.- 返回:
- the customizers that will be applied
-
setTomcatProtocolHandlerCustomizers
public void setTomcatProtocolHandlerCustomizers(Collection<? extends TomcatProtocolHandlerCustomizer<?>> tomcatProtocolHandlerCustomizers) SetTomcatProtocolHandlerCustomizers that should be applied to the TomcatConnector. Calling this method will replace any existing customizers.- 参数:
tomcatProtocolHandlerCustomizers- the customizers to set- 从以下版本开始:
- 2.2.0
-
addProtocolHandlerCustomizers
public void addProtocolHandlerCustomizers(TomcatProtocolHandlerCustomizer<?>... tomcatProtocolHandlerCustomizers) AddTomcatProtocolHandlerCustomizers that should be added to the TomcatConnector.- 指定者:
addProtocolHandlerCustomizers在接口中ConfigurableTomcatWebServerFactory- 参数:
tomcatProtocolHandlerCustomizers- the customizers to add- 从以下版本开始:
- 2.2.0
-
getTomcatProtocolHandlerCustomizers
Returns a mutable collection of theTomcatProtocolHandlerCustomizers that will be applied to the TomcatConnector.- 返回:
- the customizers that will be applied
- 从以下版本开始:
- 2.2.0
-
addAdditionalTomcatConnectors
AddConnectors in addition to the default connector, e.g. for SSL or AJP.Connector customizersare not applied to connectors added this way.- 参数:
connectors- the connectors to add- 从以下版本开始:
- 2.2.0
-
getAdditionalTomcatConnectors
Returns a mutable collection of theConnectors that will be added to the Tomcat.- 返回:
- the additionalTomcatConnectors
- 从以下版本开始:
- 2.2.0
-
addEngineValves
从接口复制的说明:ConfigurableTomcatWebServerFactory- 指定者:
addEngineValves在接口中ConfigurableTomcatWebServerFactory- 参数:
engineValves- the valves to add
-
getEngineValves
- 返回:
- the engine valves that will be applied
-
setUriEncoding
Set the character encoding to use for URL decoding. If not specified 'UTF-8' will be used.- 指定者:
setUriEncoding在接口中ConfigurableTomcatWebServerFactory- 参数:
uriEncoding- the uri encoding to set
-
getUriEncoding
Returns the character encoding to use for URL decoding.- 返回:
- the URI encoding
-
setContextLifecycleListeners
public void setContextLifecycleListeners(Collection<? extends LifecycleListener> contextLifecycleListeners) SetLifecycleListeners that should be applied to the TomcatContext. Calling this method will replace any existing listeners.- 参数:
contextLifecycleListeners- the listeners to set
-
getContextLifecycleListeners
Returns a mutable collection of theLifecycleListeners that will be applied to the TomcatContext.- 返回:
- the context lifecycle listeners that will be applied
-
addContextLifecycleListeners
AddLifecycleListeners that should be added to the TomcatContext.- 参数:
contextLifecycleListeners- the listeners to add
-
getTomcatWebServer
Factory method called to create theTomcatWebServer. Subclasses can override this method to return a differentTomcatWebServeror apply additional processing to the Tomcat server.- 参数:
tomcat- the Tomcat server.- 返回:
- a new
TomcatWebServerinstance
-
setProtocol
The Tomcat protocol to use when create theConnector.- 参数:
protocol- the protocol- 另请参阅:
-
setDisableMBeanRegistry
public void setDisableMBeanRegistry(boolean disableMBeanRegistry) Set whether the factory should disable Tomcat's MBean registry prior to creating the server.- 参数:
disableMBeanRegistry- whether to disable the MBean registry- 从以下版本开始:
- 2.2.0
-
setUseApr
public void setUseApr(boolean useApr) Whether to use APR.- 参数:
useApr- whether to use APR- 从以下版本开始:
- 3.4.4
-