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:
init
in interfaceio.vertx.core.Verticle
- Overrides:
init
in 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
startPromise
some time later when start up is complete. NOTE: UsingasyncStart()
is recommended.- Specified by:
start
in interfaceio.vertx.core.Verticle
- Overrides:
start
in 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
stopPromise
some time later when clean-up is complete. NOTE: UsingasyncStop()
is recommended.- Specified by:
stop
in interfaceio.vertx.core.Verticle
- Overrides:
stop
in 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
Uni
completed with the start up is complete. Propagating a failure fails the deployment of the verticle- Returns:
- a
Uni
completed 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
Uni
completed when the clean-up is complete.- Returns:
- a
Uni
completed when the clean-up completes, or failed if the verticle cannot be stopped gracefully.
-