Class UndertowWebServer
java.lang.Object
org.springframework.boot.web.embedded.undertow.UndertowWebServer
- All Implemented Interfaces:
- WebServer
- Direct Known Subclasses:
- UndertowServletWebServer
WebServer that can be used to control an Undertow web server. Usually this
 class should be created using the UndertowReactiveWebServerFactory and not
 directly.- Since:
- 2.0.0
- Author:
- Ivan Sopov, Andy Wilkinson, EddĂș MelĂ©ndez, Christoph Dreis, Brian Clozel
- 
Constructor SummaryConstructorsConstructorDescriptionUndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart) Create a newUndertowWebServerinstance.UndertowWebServer(io.undertow.Undertow.Builder builder, Iterable<HttpHandlerFactory> httpHandlerFactories, boolean autoStart) Create a newUndertowWebServerinstance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected io.undertow.server.HttpHandlerintgetPort()Return the port this server is listening on.protected Stringio.undertow.UndertowReturns theUndertow server.voidshutDownGracefully(GracefulShutdownCallback callback) Initiates a graceful shutdown of the Undertow web server.voidstart()Starts the web server.voidstop()Stops the web server.
- 
Constructor Details- 
UndertowWebServerpublic UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart) Create a newUndertowWebServerinstance.- Parameters:
- builder- the builder
- autoStart- if the server should be started
 
- 
UndertowWebServerpublic UndertowWebServer(io.undertow.Undertow.Builder builder, Iterable<HttpHandlerFactory> httpHandlerFactories, boolean autoStart) Create a newUndertowWebServerinstance.- Parameters:
- builder- the builder
- httpHandlerFactories- the handler factories
- autoStart- if the server should be started
- Since:
- 2.3.0
 
 
- 
- 
Method Details- 
startDescription copied from interface:WebServerStarts the web server. Calling this method on an already started server has no effect.- Specified by:
- startin interface- WebServer
- Throws:
- WebServerException- if the server cannot be started
 
- 
createHttpHandlerprotected io.undertow.server.HttpHandler createHttpHandler()
- 
stopDescription copied from interface:WebServerStops the web server. Calling this method on an already stopped server has no effect.- Specified by:
- stopin interface- WebServer
- Throws:
- WebServerException- if the server cannot be stopped
 
- 
getPortpublic int getPort()Description copied from interface:WebServerReturn the port this server is listening on.
- 
getUndertowpublic io.undertow.Undertow getUndertow()Returns theUndertow server. Returnsnulluntil the server has been started.- Returns:
- the Undertow server or nullif the server hasn't been started yet
- Since:
- 3.3.0
 
- 
shutDownGracefullyInitiates a graceful shutdown of the Undertow web server. Handling of new requests is prevented and the givencallbackis invoked at the end of the attempt. The attempt can be explicitly ended by invokingstop().Once shutdown has been initiated Undertow will return an HTTP 503response for any new or existing connections.- Specified by:
- shutDownGracefullyin interface- WebServer
- Parameters:
- callback- the callback to invoke when the graceful shutdown completes
 
- 
getStartLogMessage
 
-