Package: io.vertx.lang.groovy

## [Groovy] Class ScriptVerticle

- io.vertx.lang.groovy.ScriptVerticle

- 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>`
  Authors:
    Julien Viet

- - ### Constructor Summary

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

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `start(io.vertx.core.Future<java.lang.Void> startFuture)` Start the verticle instance.
    `void` | `stop(io.vertx.core.Future<java.lang.Void> stopFuture)` Stop the verticle instance.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class io.vertx.core.AbstractVerticle` | `io.vertx.core.AbstractVerticle#init(io.vertx.core.Vertx, io.vertx.core.Context), io.vertx.core.AbstractVerticle#start(), io.vertx.core.AbstractVerticle#start(io.vertx.core.Future), io.vertx.core.AbstractVerticle#stop(), io.vertx.core.AbstractVerticle#stop(io.vertx.core.Future), io.vertx.core.AbstractVerticle#config(), io.vertx.core.AbstractVerticle#processArgs(), io.vertx.core.AbstractVerticle#deploymentID(), io.vertx.core.AbstractVerticle#getVertx(), io.vertx.core.AbstractVerticle#wait(long, int), io.vertx.core.AbstractVerticle#wait(long), io.vertx.core.AbstractVerticle#wait(), io.vertx.core.AbstractVerticle#equals(java.lang.Object), io.vertx.core.AbstractVerticle#toString(), io.vertx.core.AbstractVerticle#hashCode(), io.vertx.core.AbstractVerticle#getClass(), io.vertx.core.AbstractVerticle#notify(), io.vertx.core.AbstractVerticle#notifyAll()`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### ScriptVerticle(groovy.lang.Script script)

  - ### Method Detail

    - #### @java.lang.Override void start(io.vertx.core.Future<java.lang.Void> startFuture)

      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 io.vertx.core.Future#complete or io.vertx.core.Future#fail the future.

      Parameters:
        `startFuture` - the future

    - #### @java.lang.Override void stop(io.vertx.core.Future<java.lang.Void> stopFuture)

      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 io.vertx.core.Future#complete or io.vertx.core.Future#fail the future.

      Parameters:
        `stopFuture` - the future