Class NettyReactiveWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
org.springframework.boot.web.reactive.server.AbstractReactiveWebServerFactory
org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory
- All Implemented Interfaces:
- ConfigurableReactiveWebServerFactory,- ReactiveWebServerFactory,- ConfigurableWebServerFactory,- ErrorPageRegistry,- WebServerFactory
ReactiveWebServerFactory that can be used to create NettyWebServers.- Since:
- 2.0.0
- Author:
- Brian Clozel
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddRouteProviders(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.Methods inherited from class org.springframework.boot.web.server.AbstractConfigurableWebServerFactoryaddErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getOrCreateSslStoreProvider, getPort, getServerHeader, getSsl, getSslBundle, getSslStoreProvider, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslBundles, setSslStoreProviderMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.web.server.ConfigurableWebServerFactorysetAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslBundles, setSslStoreProviderMethods inherited from interface org.springframework.boot.web.server.ErrorPageRegistryaddErrorPages
- 
Constructor Details- 
NettyReactiveWebServerFactorypublic NettyReactiveWebServerFactory()
- 
NettyReactiveWebServerFactorypublic NettyReactiveWebServerFactory(int port) 
 
- 
- 
Method Details- 
getWebServerDescription copied from interface: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).- Parameters:
- httpHandler- the HTTP handler in charge of processing requests
- Returns:
- a fully configured and started WebServer
- See Also:
 
- 
getServerCustomizersReturns a mutable collection of theNettyServerCustomizers that will be applied to the Netty server builder.- Returns:
- the customizers that will be applied
 
- 
setServerCustomizersSetNettyServerCustomizers that should be applied to the Netty server builder. Calling this method will replace any existing customizers.- Parameters:
- serverCustomizers- the customizers to set
 
- 
addServerCustomizersAddNettyServerCustomizers that should be applied while building the server.- Parameters:
- serverCustomizers- the customizers to add
 
- 
addRouteProvidersAddNettyRouteProviders that should be applied, in order, before the handler for the Spring application.- Parameters:
- routeProviders- the route providers to add
 
- 
setLifecycleTimeoutSet the maximum amount of time that should be waited when starting or stopping the server.- Parameters:
- lifecycleTimeout- the lifecycle timeout
 
- 
setUseForwardHeaderspublic void setUseForwardHeaders(boolean useForwardHeaders) Set if x-forward-* headers should be processed.- Parameters:
- useForwardHeaders- if x-forward headers should be used
- Since:
- 2.1.0
 
- 
setResourceFactorySet theReactorResourceFactoryto get the shared resources from.- Parameters:
- resourceFactory- the server resources
- Since:
- 2.1.0
 
- 
setShutdownDescription copied from interface:ConfigurableWebServerFactorySets the shutdown configuration that will be applied to the server.- Specified by:
- setShutdownin interface- ConfigurableWebServerFactory
- Overrides:
- setShutdownin class- AbstractConfigurableWebServerFactory
- Parameters:
- shutdown- the shutdown configuration
 
- 
getShutdownDescription copied from class:AbstractConfigurableWebServerFactoryReturns the shutdown configuration that will be applied to the server.- Overrides:
- getShutdownin class- AbstractConfigurableWebServerFactory
- Returns:
- the shutdown configuration
 
 
-