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.void
init(io.vertx.core.Vertx vertx, io.vertx.core.Context context)
Initialise the verticle.void
start(io.vertx.core.Promise<Void> startPromise)
Start the verticle.void
stop(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:
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
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
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
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
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
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
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
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
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.
-
-