Class MainVerticle

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

    public class MainVerticle
    extends io.vertx.core.AbstractVerticle
    Author:
    Paul Withers Entry point and Vert.x Verticle
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String HEADER_GNU_TP  
      static String X_HEADER  
      • Fields inherited from class io.vertx.core.AbstractVerticle

        context, vertx
    • Constructor Summary

      Constructors 
      Constructor Description
      MainVerticle​(String configDir)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isDebug()
      Check if the application gets started in debug mode this will extend the loop timeout to avoid warnings of debugger blocking the event loop
      static io.vertx.core.Future<io.vertx.core.json.JsonObject> loadConfig​(io.vertx.core.Vertx vertx, String configDirName)
      Loads the configuration from the internal configuration file or JSON file that is in the configuration directory
      static void main​(String[] args)
      Entrypoint, initialising and running an instance of this class
      static void runVerticle​(MainVerticle mainVerticle)
      Loads config and runs an instance of this class using current Vert.x instance
      void start​(io.vertx.core.Promise<Void> startPromise)  
      • Methods inherited from class io.vertx.core.AbstractVerticle

        config, deploymentID, getVertx, init, processArgs, start, stop, stop
    • Constructor Detail

      • MainVerticle

        public MainVerticle​(String configDir)
        Constructor
        Parameters:
        configDir - where JSON configuration files can be found
    • Method Detail

      • isDebug

        public static boolean isDebug()
        Check if the application gets started in debug mode this will extend the loop timeout to avoid warnings of debugger blocking the event loop
        Returns:
        true if debug mode
      • loadConfig

        public static io.vertx.core.Future<io.vertx.core.json.JsonObject> loadConfig​(io.vertx.core.Vertx vertx,
                                                                                     String configDirName)
        Loads the configuration from the internal configuration file or JSON file that is in the configuration directory
        Parameters:
        vertx - - the vertx instance
        configDirName - - the configuration directory
        Returns:
        Future with a configuration
      • main

        public static void main​(String[] args)
        Entrypoint, initialising and running an instance of this class
        Parameters:
        args - configuration directory
      • runVerticle

        public static void runVerticle​(MainVerticle mainVerticle)
        Loads config and runs an instance of this class using current Vert.x instance
        Parameters:
        mainVerticle - to run
      • start

        public void start​(io.vertx.core.Promise<Void> startPromise)
                   throws Exception
        Specified by:
        start in interface io.vertx.core.Verticle
        Overrides:
        start in class io.vertx.core.AbstractVerticle
        Throws:
        Exception