Class AbstractVerticle
- java.lang.Object
-
- io.vertx.core.AbstractVerticle
-
- io.smallrye.mutiny.vertx.core.AbstractVerticle
-
- All Implemented Interfaces:
io.vertx.core.Verticle
public class AbstractVerticle extends io.vertx.core.AbstractVerticle
-
-
Constructor Summary
Constructors Constructor Description AbstractVerticle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>asyncStart()Start the verticle.io.smallrye.mutiny.Uni<Void>asyncStop()Stop the verticle.voidinit(io.vertx.core.Vertx vertx, io.vertx.core.Context context)Initialise the verticle.voidstart(io.vertx.core.Promise<Void> startPromise)Start the verticle.voidstop(io.vertx.core.Promise<Void> stopPromise)Stop the verticle.
-
-
-
Field Detail
-
vertx
protected Vertx vertx
-
-
Method Detail
-
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
public void start(io.vertx.core.Promise<Void> startPromise) throws Exception
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
public void stop(io.vertx.core.Promise<Void> stopPromise) throws Exception
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
public io.smallrye.mutiny.Uni<Void> 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
public io.smallrye.mutiny.Uni<Void> 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.
-
-