Package kos.core

Class VertxWebServer

  • All Implemented Interfaces:
    io.vertx.core.Verticle

    public class VertxWebServer
    extends io.vertx.core.AbstractVerticle
    Abstracts the creation of a Vert.x web server, automating a few repetitive tasks, automatically loading routes if available, and avoiding common mistakes made during the application bootstrap. This class was either designed to be compatible with Vert.x Verticle mechanism or to be run as standalone Java application.
    • Field Detail

      • log

        private static final io.vertx.core.logging.Logger log
    • Constructor Detail

      • VertxWebServer

        public VertxWebServer()
    • Method Detail

      • start

        public void start()
        Overrides:
        start in class io.vertx.core.AbstractVerticle
      • start

        public void start​(io.vertx.core.Promise<Void> startFuture)
      • startServer

        private void startServer​(io.vertx.core.Promise<Void> startFuture)
      • loadServerOptions

        protected io.vertx.core.http.HttpServerOptions loadServerOptions()
        Loads the HttpServerOptions from the Class Path. Developers are encouraged to override this method whenever needed.
        Returns:
        the found or created HttpServerOptions object.
      • createServerOptions

        private io.vertx.core.http.HttpServerOptions createServerOptions()
        The default server configuration. It will be triggered when the auto-discovery mechanism failed to find one in the classpath.
      • notifyWebServerDeploymentListeners

        private void notifyWebServerDeploymentListeners​(io.vertx.core.http.HttpServerOptions httpServerOptions)
      • beforeStart

        protected void beforeStart()
        Executes before the server is started.
      • afterStart

        protected void afterStart​(io.vertx.core.http.HttpServer server)
        Executes as soon as the server is started.
        Parameters:
        server - reference to instantiated (and started) server.
      • router

        public SimplifiedRouter router()
        Retrieves the current configured router. If none is defined, it will lazily instantiate the default SimplifiedRouter configuration.