类 UndertowWebServer

java.lang.Object
org.springframework.boot.web.embedded.undertow.UndertowWebServer
所有已实现的接口:
WebServer
直接已知子类:
UndertowServletWebServer

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.
从以下版本开始:
2.0.0
作者:
Ivan Sopov, Andy Wilkinson, Eddú Meléndez, Christoph Dreis, Brian Clozel
  • 构造器详细资料

    • UndertowWebServer

      public UndertowWebServer(io.undertow.Undertow.Builder builder, boolean autoStart)
      Create a new UndertowWebServer instance.
      参数:
      builder - the builder
      autoStart - if the server should be started
    • UndertowWebServer

      public UndertowWebServer(io.undertow.Undertow.Builder builder, Iterable<HttpHandlerFactory> httpHandlerFactories, boolean autoStart)
      Create a new UndertowWebServer instance.
      参数:
      builder - the builder
      httpHandlerFactories - the handler factories
      autoStart - if the server should be started
      从以下版本开始:
      2.3.0
  • 方法详细资料

    • start

      public void start() throws WebServerException
      从接口复制的说明: WebServer
      Starts 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

      public void stop() throws WebServerException
      从接口复制的说明: WebServer
      Stops 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()
      从接口复制的说明: WebServer
      Return the port this server is listening on.
      指定者:
      getPort 在接口中 WebServer
      返回:
      the port (or -1 if none)
    • getUndertow

      public io.undertow.Undertow getUndertow()
      Returns the Undertow server. Returns null until the server has been started.
      返回:
      the Undertow server or null if the server hasn't been started yet
      从以下版本开始:
      3.3.0
    • shutDownGracefully

      public void shutDownGracefully(GracefulShutdownCallback callback)
      Initiates a graceful shutdown of the Undertow web server. Handling of new requests is prevented and the given callback is invoked at the end of the attempt. The attempt can be explicitly ended by invoking stop().

      Once shutdown has been initiated Undertow will return an HTTP 503 response for any new or existing connections.

      指定者:
      shutDownGracefully 在接口中 WebServer
      参数:
      callback - the callback to invoke when the graceful shutdown completes
    • getStartLogMessage

      protected String getStartLogMessage()