Class UndertowWebServer
- java.lang.Object
- org.springframework.boot.web.embedded.undertow.UndertowWebServer
- All Implemented Interfaces:
WebServer
public class UndertowWebServer extends Object implements WebServer
WebServer
that can be used to control an Undertow web server. Usually this class should be created using theUndertowReactiveWebServerFactory
and not directly.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart)
Create a newUndertowWebServer
instance.UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart, Closeable closeable)
Create a newUndertowWebServer
instance.
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
UndertowWebServer
public UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart)
Create a newUndertowWebServer
instance.- Parameters:
builder
- the builderautoStart
- if the server should be started
UndertowWebServer
public UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart, Closeable closeable)
Create a newUndertowWebServer
instance.- Parameters:
builder
- the builderautoStart
- if the server should be startedcloseable
- called when the server is stopped- Since:
- 2.0.4
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