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 the
handler for the Spring application. |
void |
addServerCustomizers(NettyServerCustomizer... serverCustomizers)
Add
NettyServerCustomizer s that should 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. |
WebServer |
getWebServer(org.springframework.http.server.reactive.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(org.springframework.http.client.reactive.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 |
setUseForwardHeaders(boolean useForwardHeaders)
Set if x-forward-* headers should be processed.
|
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, 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(org.springframework.http.server.reactive.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 applied while building the server.serverCustomizers
- the customizers to addpublic void addRouteProviders(NettyRouteProvider... routeProviders)
NettyRouteProvider
s that should be applied, in order, before the 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(org.springframework.http.client.reactive.ReactorResourceFactory resourceFactory)
ReactorResourceFactory
to get the shared resources from.resourceFactory
- the server resourcesCopyright © 2019 Pivotal Software, Inc.. All rights reserved.