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 the UndertowReactiveWebServerFactory
and not
directly.Constructor and Description |
---|
UndertowWebServer(io.undertow.Undertow.Builder builder,
boolean autoStart)
Create a new
UndertowWebServer instance. |
UndertowWebServer(io.undertow.Undertow.Builder builder,
boolean autoStart,
Closeable closeable)
Create a new
UndertowWebServer instance. |
UndertowWebServer(io.undertow.Undertow.Builder builder,
boolean autoStart,
Closeable closeable,
GracefulShutdown gracefulShutdown)
Create a new
UndertowWebServer instance. |
Modifier and Type | Method and Description |
---|---|
int |
getPort()
Return the port this server is listening on.
|
boolean |
shutDownGracefully()
Gracefully shuts down the web server by preventing the handling of new requests and
waiting for a configurable period for there to be no active requests.
|
void |
start()
Starts the web server.
|
void |
stop()
Stops the web server.
|
public UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart)
UndertowWebServer
instance.builder
- the builderautoStart
- if the server should be startedpublic UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart, Closeable closeable)
UndertowWebServer
instance.builder
- the builderautoStart
- if the server should be startedcloseable
- called when the server is stoppedpublic UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart, Closeable closeable, GracefulShutdown gracefulShutdown)
UndertowWebServer
instance.builder
- the builderautoStart
- if the server should be startedcloseable
- called when the server is stoppedgracefulShutdown
- handler for graceful shutdownpublic void start() throws WebServerException
WebServer
start
in interface WebServer
WebServerException
- if the server cannot be startedpublic void stop() throws WebServerException
WebServer
stop
in interface WebServer
WebServerException
- if the server cannot be stoppedpublic int getPort()
WebServer
public boolean shutDownGracefully()
WebServer
shutDownGracefully
in interface WebServer
true
if graceful shutdown completed within the period, otherwise
false