类 UndertowWebServer
java.lang.Object
org.springframework.boot.web.embedded.undertow.UndertowWebServer
- 所有已实现的接口:
WebServer
- 直接已知子类:
UndertowServletWebServer
WebServer that can be used to control an Undertow web server. Usually this
class should be created using the UndertowReactiveWebServerFactory and not
directly.- 从以下版本开始:
- 2.0.0
- 作者:
- Ivan Sopov, Andy Wilkinson, Eddú Meléndez, Christoph Dreis, Brian Clozel
-
构造器概要
构造器构造器说明UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart) Create a newUndertowWebServerinstance.UndertowWebServer(io.undertow.Undertow.Builder builder, Iterable<HttpHandlerFactory> httpHandlerFactories, boolean autoStart) Create a newUndertowWebServerinstance. -
方法概要
修饰符和类型方法说明protected 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.
-
构造器详细资料
-
UndertowWebServer
public UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart) Create a newUndertowWebServerinstance.- 参数:
builder- the builderautoStart- if the server should be started
-
UndertowWebServer
public UndertowWebServer(io.undertow.Undertow.Builder builder, Iterable<HttpHandlerFactory> httpHandlerFactories, boolean autoStart) Create a newUndertowWebServerinstance.- 参数:
builder- the builderhttpHandlerFactories- the handler factoriesautoStart- if the server should be started- 从以下版本开始:
- 2.3.0
-
-
方法详细资料
-
start
从接口复制的说明:WebServerStarts the web server. Calling this method on an already started server has no effect.- 指定者:
start在接口中WebServer- 抛出:
WebServerException- if the server cannot be started
-
createHttpHandler
protected io.undertow.server.HttpHandler createHttpHandler() -
stop
从接口复制的说明:WebServerStops the web server. Calling this method on an already stopped server has no effect.- 指定者:
stop在接口中WebServer- 抛出:
WebServerException- if the server cannot be stopped
-
getPort
public int getPort()从接口复制的说明:WebServerReturn the port this server is listening on. -
getUndertow
public io.undertow.Undertow getUndertow()Returns theUndertow server. Returnsnulluntil the server has been started.- 返回:
- the Undertow server or
nullif the server hasn't been started yet - 从以下版本开始:
- 3.3.0
-
shutDownGracefully
Initiates 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.- 指定者:
shutDownGracefully在接口中WebServer- 参数:
callback- the callback to invoke when the graceful shutdown completes
-
getStartLogMessage
-