io.vertx.core

## Interface Verticle

- All Known Implementing Classes:
    AbstractVerticle, AbstractVerticle, MailServiceVerticle, ShellVerticle, SyncVerticle

      public interface Verticle

  A verticle is a piece of code that can be deployed by Vert.x.

  Use of verticles with Vert.x is entirely optional, but if you use them they provide an actor-like deployment and concurrency model, out of the box.

  Vert.x does not provide a strict actor implementation, but there are significant similarities.

  You can think of verticle instances as a bit like actors in the Actor Model. A typical verticle-based Vert.x application will be composed of many verticle instances in each Vert.x instance.

  The verticles communicate with each other by sending messages over the `EventBus`.

  Author:
    Tim Fox

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Vertx` | `getVertx()` Get a reference to the Vert.x instance that deployed this verticle
    `void` | `init(Vertx vertx, Context context)` Initialise the verticle with the Vert.x instance and the context.
    `void` | `start(Future<Void> startFuture)` Start the verticle instance.
    `void` | `stop(Future<Void> stopFuture)` Stop the verticle instance.

- - ### Method Detail

    - #### getVertx

          Vertx getVertx()

      Get a reference to the Vert.x instance that deployed this verticle
      Returns:
        A reference to the Vert.x instance

    - #### init

          void init(Vertx vertx,
                    Context context)

      Initialise the verticle with the Vert.x instance and the context.

      This method is called by Vert.x when the instance is deployed. You do not call it yourself.

      Parameters:
        `vertx` - the Vert.x instance
        `context` - the context

    - #### start

          void start(Future<Void> startFuture)
              throws Exception

      Start the verticle instance.

      Vert.x calls this method when deploying the instance. You do not call it yourself.

      A future is passed into the method, and when deployment is complete the verticle should either call `Future.complete(T)` or `Future.fail(java.lang.Throwable)` the future.

      Parameters:
        `startFuture` - the future
      Throws:
        `Exception`

    - #### stop

          void stop(Future<Void> stopFuture)
             throws Exception

      Stop the verticle instance.

      Vert.x calls this method when un-deploying the instance. You do not call it yourself.

      A future is passed into the method, and when un-deployment is complete the verticle should either call `Future.complete(T)` or `Future.fail(java.lang.Throwable)` the future.

      Parameters:
        `stopFuture` - the future
      Throws:
        `Exception`

Copyright © 2015. All rights reserved.