io.vertx.lang.groovy

## Class ScriptVerticle

- java.lang.Object
- - io.vertx.core.AbstractVerticle
  - - io.vertx.lang.groovy.ScriptVerticle

- All Implemented Interfaces:
    Verticle

      public class ScriptVerticle
      extends AbstractVerticle

  A Vert.x native verticle wrapping a Groovy script, the script will be executed when the Verticle starts. When the script defines a no arg accessible `vertxStop` method, this method will be invoked when the verticle stops. Before the script starts the following objects are bound in the script binding:
  - `vertx`: the `Vertx` object
  - `deploymentID`: the deploymentID of this Verticle
  - `config`: the Verticle config as a `Map<String, Object>`
  Author:
    Julien Viet

- - ### Field Summary

    - ### Fields inherited from class io.vertx.core.AbstractVerticle

      `context, vertx`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScriptVerticle(groovy.lang.Script script)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `start(Future<Void> startFuture)` Start the verticle instance.
    `void` | `stop(Future<Void> stopFuture)` Stop the verticle instance.

    - ### Methods inherited from class io.vertx.core.AbstractVerticle

      `config, deploymentID, getVertx, init, processArgs, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ScriptVerticle

          public ScriptVerticle(groovy.lang.Script script)

  - ### Method Detail

    - #### start

          public 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.

      Specified by:
        `start` in interface `Verticle`
      Overrides:
        `start` in class `AbstractVerticle`
      Parameters:
        `startFuture` - the future
      Throws:
        `Exception`

    - #### stop

          public 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.

      Specified by:
        `stop` in interface `Verticle`
      Overrides:
        `stop` in class `AbstractVerticle`
      Parameters:
        `stopFuture` - the future
      Throws:
        `Exception`

Copyright © 2017. All rights reserved.