Class BaseRoutableVerticle

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

    public abstract class BaseRoutableVerticle
    extends io.vertx.core.AbstractVerticle
    implements Routable
    A super class containing a router and boiler plate methods for managing http interaction.
    Author:
    Adam Gibson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int port  
      protected io.vertx.ext.web.Router router  
      • Fields inherited from class io.vertx.core.AbstractVerticle

        context, vertx
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.vertx.ext.web.Router router()
      Returns the Router associated with this object
      protected void setupWebServer​(io.vertx.core.Promise<java.lang.Void> startPromise)
      Start an http server the port with the value configured as the httpPort key found in AbstractVerticle.config()
      void start​(io.vertx.core.Promise<java.lang.Void> startPromise)  
      void stop​(io.vertx.core.Promise<java.lang.Void> stopPromise)  
      io.vertx.core.Vertx vertx()
      Returns the Vertx instance associated with this object
      • Methods inherited from class io.vertx.core.AbstractVerticle

        config, deploymentID, getVertx, init, processArgs, start, start, stop, stop
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • router

        protected io.vertx.ext.web.Router router
      • port

        protected int port
    • Constructor Detail

      • BaseRoutableVerticle

        public BaseRoutableVerticle()
    • Method Detail

      • setupWebServer

        protected void setupWebServer​(io.vertx.core.Promise<java.lang.Void> startPromise)
        Start an http server the port with the value configured as the httpPort key found in AbstractVerticle.config()
      • start

        public void start​(io.vertx.core.Promise<java.lang.Void> startPromise)
        Specified by:
        start in interface io.vertx.core.Verticle
      • stop

        public void stop​(io.vertx.core.Promise<java.lang.Void> stopPromise)
        Specified by:
        stop in interface io.vertx.core.Verticle
      • router

        public io.vertx.ext.web.Router router()
        Description copied from interface: Routable
        Returns the Router associated with this object
        Specified by:
        router in interface Routable
        Returns:
        router
      • vertx

        public io.vertx.core.Vertx vertx()
        Description copied from interface: Routable
        Returns the Vertx instance associated with this object
        Specified by:
        vertx in interface Routable
        Returns:
        router