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 objectdeploymentID
: the deploymentID of this Verticleconfig
: the Verticle config as a Map<String, Object>
Constructor and description |
---|
ScriptVerticle
(groovy.lang.Script script) |
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#getVertx(), io.vertx.core.AbstractVerticle#deploymentID(), 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() |
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.
startFuture
- the futureStop 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.
stopFuture
- the future