Class NettyWebServer
- java.lang.Object
- org.springframework.boot.web.embedded.netty.NettyWebServer
- All Implemented Interfaces:
WebServer
public class NettyWebServer extends Object implements WebServer
WebServer
that can be used to control a Reactor Netty web server. Usually this class should be created using theNettyReactiveWebServerFactory
and not directly.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description NettyWebServer(reactor.netty.http.server.HttpServer httpServer, org.springframework.http.server.reactive.ReactorHttpHandlerAdapter handlerAdapter, Duration lifecycleTimeout)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPort()
Return the port this server is listening on.void
start()
Starts the web server.void
stop()
Stops the web server.
Constructor Detail
NettyWebServer
public NettyWebServer(reactor.netty.http.server.HttpServer httpServer, org.springframework.http.server.reactive.ReactorHttpHandlerAdapter handlerAdapter, Duration lifecycleTimeout)
Method Detail
start
public void start() throws WebServerException
Description copied from interface:WebServer
Starts the web server. Calling this method on an already started server has no effect.- Specified by:
start
in interfaceWebServer
- Throws:
WebServerException
- if the server cannot be started
stop
public void stop() throws WebServerException
Description copied from interface:WebServer
Stops the web server. Calling this method on an already stopped server has no effect.- Specified by:
stop
in interfaceWebServer
- Throws:
WebServerException
- if the server cannot be stopped