public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory
ReactiveWebServerFactory
that can be used to create NettyWebServer
s.Constructor and Description |
---|
NettyReactiveWebServerFactory() |
NettyReactiveWebServerFactory(int port) |
Modifier and Type | Method and Description |
---|---|
void |
addRouteProviders(NettyRouteProvider... routeProviders)
Add
NettyRouteProvider s that should be applied, in order, before the
handler for the Spring application. |
void |
addServerCustomizers(NettyServerCustomizer... serverCustomizers)
Add
NettyServerCustomizer s that should be applied while building the
server. |
Collection<NettyServerCustomizer> |
getServerCustomizers()
Returns a mutable collection of the
NettyServerCustomizer s that will be
applied to the Netty server builder. |
Shutdown |
getShutdown()
Returns the shutdown configuration that will be applied to the server.
|
WebServer |
getWebServer(HttpHandler httpHandler)
Gets a new fully configured but paused
WebServer 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 the
ReactorResourceFactory to get the shared resources from. |
void |
setServerCustomizers(Collection<? extends NettyServerCustomizer> serverCustomizers)
Set
NettyServerCustomizer 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.
|
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getOrCreateSslStoreProvider, 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 NettyReactiveWebServerFactory()
public NettyReactiveWebServerFactory(int port)
public WebServer getWebServer(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()
public Collection<NettyServerCustomizer> getServerCustomizers()
NettyServerCustomizer
s that will be
applied to the Netty server builder.public void setServerCustomizers(Collection<? extends NettyServerCustomizer> serverCustomizers)
NettyServerCustomizer
s that should be applied to the Netty server
builder. Calling this method will replace any existing customizers.serverCustomizers
- the customizers to setpublic void addServerCustomizers(NettyServerCustomizer... serverCustomizers)
NettyServerCustomizer
s that should be applied while building the
server.serverCustomizers
- the customizers to addpublic void addRouteProviders(NettyRouteProvider... routeProviders)
NettyRouteProvider
s that should be applied, in order, before the
handler for the Spring application.routeProviders
- the route providers to addpublic void setLifecycleTimeout(Duration lifecycleTimeout)
lifecycleTimeout
- the lifecycle timeoutpublic void setUseForwardHeaders(boolean useForwardHeaders)
useForwardHeaders
- if x-forward headers should be usedpublic void setResourceFactory(ReactorResourceFactory resourceFactory)
ReactorResourceFactory
to get the shared resources from.resourceFactory
- the server resourcespublic void setShutdown(Shutdown shutdown)
ConfigurableWebServerFactory
setShutdown
in interface ConfigurableWebServerFactory
setShutdown
in class AbstractConfigurableWebServerFactory
shutdown
- the shutdown configurationpublic Shutdown getShutdown()
AbstractConfigurableWebServerFactory
getShutdown
in class AbstractConfigurableWebServerFactory