类 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 NettyWebServer
s.- 从以下版本开始:
- 2.0.0
- 作者:
- Brian Clozel, Moritz Halbritter, Scott Frederick
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
addRouteProviders
(NettyRouteProvider... routeProviders) AddNettyRouteProvider
s that should be applied, in order, before the handler for the Spring application.void
addServerCustomizers
(NettyServerCustomizer... serverCustomizers) AddNettyServerCustomizer
s that should be applied while building the server.Returns a mutable collection of theNettyServerCustomizer
s 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 pausedWebServer
instance.void
setLifecycleTimeout
(Duration lifecycleTimeout) Set the maximum amount of time that should be waited when starting or stopping the server.void
setResourceFactory
(ReactorResourceFactory resourceFactory) Set theReactorResourceFactory
to get the shared resources from.void
setServerCustomizers
(Collection<? extends NettyServerCustomizer> serverCustomizers) SetNettyServerCustomizer
s that should be applied to the Netty server builder.void
setShutdown
(Shutdown shutdown) Sets the shutdown configuration that will be applied to the server.void
setUseForwardHeaders
(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
从接口复制的说明:ReactiveWebServerFactory
Gets a new fully configured but pausedWebServer
instance. Clients should not be able to connect to the returned server untilWebServer.start()
is called (which happens when theApplicationContext
has been fully refreshed).- 参数:
httpHandler
- the HTTP handler in charge of processing requests- 返回:
- a fully configured and started
WebServer
- 另请参阅:
-
getServerCustomizers
Returns a mutable collection of theNettyServerCustomizer
s that will be applied to the Netty server builder.- 返回:
- the customizers that will be applied
-
setServerCustomizers
SetNettyServerCustomizer
s that should be applied to the Netty server builder. Calling this method will replace any existing customizers.- 参数:
serverCustomizers
- the customizers to set
-
addServerCustomizers
AddNettyServerCustomizer
s that should be applied while building the server.- 参数:
serverCustomizers
- the customizers to add
-
addRouteProviders
AddNettyRouteProvider
s 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 theReactorResourceFactory
to get the shared resources from.- 参数:
resourceFactory
- the server resources- 从以下版本开始:
- 2.1.0
-
setShutdown
从接口复制的说明:ConfigurableWebServerFactory
Sets the shutdown configuration that will be applied to the server.- 指定者:
setShutdown
在接口中ConfigurableWebServerFactory
- 覆盖:
setShutdown
在类中AbstractConfigurableWebServerFactory
- 参数:
shutdown
- the shutdown configuration
-
getShutdown
从类复制的说明:AbstractConfigurableWebServerFactory
Returns the shutdown configuration that will be applied to the server.- 覆盖:
getShutdown
在类中AbstractConfigurableWebServerFactory
- 返回:
- the shutdown configuration
-