Class AbstractVerticle
- All Implemented Interfaces:
io.vertx.core.Verticle
-
Field Summary
FieldsFields inherited from class io.vertx.core.AbstractVerticle
context -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.vertx.core.AbstractVerticle
config, deploymentID, getVertx, processArgs, start, stop
-
Field Details
-
vertx
-
-
Constructor Details
-
AbstractVerticle
public AbstractVerticle()
-
-
Method Details
-
init
public void init(io.vertx.core.Vertx vertx, io.vertx.core.Context context) Initialise the verticle. This is called by Vert.x when the verticle instance is deployed. Don't call it yourself.- Specified by:
initin interfaceio.vertx.core.Verticle- Overrides:
initin classio.vertx.core.AbstractVerticle- Parameters:
vertx- the deploying Vert.x instancecontext- the context of the verticle
-
start
Start the verticle. This is called by Vert.x when the verticle instance is deployed. Don't call it yourself.If your verticle does things in its startup which take some time then you can override this method and call the
startPromisesome time later when start up is complete. NOTE: UsingasyncStart()is recommended.- Specified by:
startin interfaceio.vertx.core.Verticle- Overrides:
startin classio.vertx.core.AbstractVerticle- Parameters:
startPromise- a promise which should be called when verticle start-up is complete.- Throws:
Exception
-
stop
Stop the verticle.This is called by Vert.x when the verticle instance is un-deployed. Don't call it yourself. If your verticle does things in its shut-down which take some time then you can override this method and call the
stopPromisesome time later when clean-up is complete. NOTE: UsingasyncStop()is recommended.- Specified by:
stopin interfaceio.vertx.core.Verticle- Overrides:
stopin classio.vertx.core.AbstractVerticle- Parameters:
stopPromise- a promise which should be called when verticle clean-up is complete.- Throws:
Exception
-
asyncStart
Start the verticle. This is called by Vert.x when the verticle instance is deployed. Don't call it yourself.If your verticle does things in its startup which take some time then you can override this method and returns a
Unicompleted with the start up is complete. Propagating a failure fails the deployment of the verticle- Returns:
- a
Unicompleted when the start up completes, or failed if the verticle cannot be started.
-
asyncStop
Stop the verticle.This is called by Vert.x when the verticle instance is un-deployed. Don't call it yourself. If your verticle does things in its shut-down which take some time then you can override this method and returns an
Unicompleted when the clean-up is complete.- Returns:
- a
Unicompleted when the clean-up completes, or failed if the verticle cannot be stopped gracefully.
-