org.springframework.boot.web.embedded.undertow

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 the UndertowReactiveWebServerFactory and not directly.
    Since:
    2.0.0
    Author:
    Ivan Sopov, Andy Wilkinson, Eddú Meléndez, Christoph Dreis, Brian Clozel
    • Constructor Detail

      • UndertowWebServer

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

        public UndertowWebServer(io.undertow.Undertow.Builder builder,
                                 boolean autoStart,
                                 Closeable closeable)
        Create a new UndertowWebServer instance.
        Parameters:
        builder - the builder
        autoStart - if the server should be started
        closeable - called when the server is stopped
        Since:
        2.0.4
    • Method Detail

      • 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 interface WebServer
        Throws:
        WebServerException - if the server cannot be stopped
      • getPort

        public int getPort()
        Description copied from interface: WebServer
        Return the port this server is listening on.
        Specified by:
        getPort in interface WebServer
        Returns:
        the port (or -1 if none)

Copyright © 2018 Pivotal Software, Inc.. All rights reserved.