Class ScriptVerticle
java.lang.Object
io.vertx.core.AbstractVerticle
io.vertx.lang.groovy.ScriptVerticle
- All Implemented Interfaces:
Deployable, Verticle
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: theVertxobjectdeploymentID: the deploymentID of this Verticleconfig: the Verticle config as aMap<String, Object>
- Author:
- Julien Viet
-
Field Summary
Fields inherited from class AbstractVerticle
context, vertx -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractVerticle
config, deploy, deploymentID, getVertx, init, processArgs, start, stop, undeploy
-
Constructor Details
-
ScriptVerticle
public ScriptVerticle(groovy.lang.Script script)
-
-
Method Details
-
start
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
Promise.complete(T, Throwable)orPromise.fail(Throwable)the future.- Specified by:
startin interfaceVerticle- Overrides:
startin classAbstractVerticle- Parameters:
startPromise- the future- Throws:
Exception
-
stop
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
Promise.complete(T, Throwable)orPromise.fail(Throwable)the future.- Specified by:
stopin interfaceVerticle- Overrides:
stopin classAbstractVerticle- Parameters:
stopPromise- the future- Throws:
Exception
-