类 NettyReactiveWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
org.springframework.boot.web.reactive.server.AbstractReactiveWebServerFactory
org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory
- 所有已实现的接口:
ConfigurableReactiveWebServerFactory,ReactiveWebServerFactory,ConfigurableWebServerFactory,ErrorPageRegistry,WebServerFactory
ReactiveWebServerFactory that can be used to create NettyWebServers.- 从以下版本开始:
- 2.0.0
- 作者:
- Brian Clozel, Moritz Halbritter, Scott Frederick
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddRouteProviders(NettyRouteProvider... routeProviders) AddNettyRouteProviders that should be applied, in order, before the handler for the Spring application.voidaddServerCustomizers(NettyServerCustomizer... serverCustomizers) AddNettyServerCustomizers that should be applied while building the server.Returns a mutable collection of theNettyServerCustomizers that will be applied to the Netty server builder.Returns the shutdown configuration that will be applied to the server.getWebServer(HttpHandler httpHandler) Gets a new fully configured but pausedWebServerinstance.voidsetLifecycleTimeout(Duration lifecycleTimeout) Set the maximum amount of time that should be waited when starting or stopping the server.voidsetResourceFactory(ReactorResourceFactory resourceFactory) Set theReactorResourceFactoryto get the shared resources from.voidsetServerCustomizers(Collection<? extends NettyServerCustomizer> serverCustomizers) SetNettyServerCustomizers that should be applied to the Netty server builder.voidsetShutdown(Shutdown shutdown) Sets the shutdown configuration that will be applied to the server.voidsetUseForwardHeaders(boolean useForwardHeaders) Set if x-forward-* headers should be processed.从类继承的方法 org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getServerNameSslBundles, getSsl, getSslBundle, getSslBundles, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, 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, setSsl, setSslBundles从接口继承的方法 org.springframework.boot.web.server.ErrorPageRegistry
addErrorPages
-
构造器详细资料
-
NettyReactiveWebServerFactory
public NettyReactiveWebServerFactory() -
NettyReactiveWebServerFactory
public NettyReactiveWebServerFactory(int port)
-
-
方法详细资料
-
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).- 参数:
httpHandler- the HTTP handler in charge of processing requests- 返回:
- a fully configured and started
WebServer - 另请参阅:
-
getServerCustomizers
Returns a mutable collection of theNettyServerCustomizers that will be applied to the Netty server builder.- 返回:
- the customizers that will be applied
-
setServerCustomizers
SetNettyServerCustomizers that should be applied to the Netty server builder. Calling this method will replace any existing customizers.- 参数:
serverCustomizers- the customizers to set
-
addServerCustomizers
AddNettyServerCustomizers that should be applied while building the server.- 参数:
serverCustomizers- the customizers to add
-
addRouteProviders
AddNettyRouteProviders that should be applied, in order, before the handler for the Spring application.- 参数:
routeProviders- the route providers to add
-
setLifecycleTimeout
Set the maximum amount of time that should be waited when starting or stopping the server.- 参数:
lifecycleTimeout- the lifecycle timeout
-
setUseForwardHeaders
public void setUseForwardHeaders(boolean useForwardHeaders) Set if x-forward-* headers should be processed.- 参数:
useForwardHeaders- if x-forward headers should be used- 从以下版本开始:
- 2.1.0
-
setResourceFactory
Set theReactorResourceFactoryto get the shared resources from.- 参数:
resourceFactory- the server resources- 从以下版本开始:
- 2.1.0
-
setShutdown
从接口复制的说明:ConfigurableWebServerFactorySets the shutdown configuration that will be applied to the server.- 指定者:
setShutdown在接口中ConfigurableWebServerFactory- 覆盖:
setShutdown在类中AbstractConfigurableWebServerFactory- 参数:
shutdown- the shutdown configuration
-
getShutdown
从类复制的说明:AbstractConfigurableWebServerFactoryReturns the shutdown configuration that will be applied to the server.- 覆盖:
getShutdown在类中AbstractConfigurableWebServerFactory- 返回:
- the shutdown configuration
-