Top Description Methods
io.vertx.core

public Interface Verticle

Known Direct Implementers
io.vertx.core.AbstractVerticle

A verticle is a piece of code that can be deployed by Vert.x.

Use of verticles with Vert.x is entirely optional, but if you use them they provide an actor-like deployment and concurrency model, out of the box.

Vert.x does not provide a strict actor implementation, but there are significant similarities.

You can think of verticle instances as a bit like actors in the Actor Model. A typical verticle-based Vert.x application will be composed of many verticle instances in each Vert.x instance.

The verticles communicate with each other by sending messages over the io.vertx.core.eventbus.EventBus.

Author
Tim Fox

Method Summary

Modifier and TypeMethod and Description
public Vertx

Returns:

A reference to the Vert.x instance
getVertx
()

Get a reference to the Vert.x instance that deployed this verticle

public void
init(Vertx
the Vert.x instance
vertx
,
Context
the context
context
)

Initialise the verticle with the Vert.x instance and the context.

public void
start(Promise<Void>
the future
startPromise
)

Start the verticle instance.

public void
stop(Promise<Void>
the future
stopPromise
)

Stop the verticle instance.

Method Detail

getVertxback to summary
public Vertx getVertx()

Get a reference to the Vert.x instance that deployed this verticle

Returns:Vertx

A reference to the Vert.x instance

initback to summary
public void init(Vertx vertx, Context context)

Initialise the verticle with the Vert.x instance and the context.

This method is called by Vert.x when the instance is deployed. You do not call it yourself.

Parameters
vertx:Vertx

the Vert.x instance

context:Context

the context

startback to summary
public void start(Promise<Void> startPromise) throws Exception

Start the verticle instance.

Vert.x calls this method when deploying the instance. You do not call it yourself.

A promise is passed into the method, and when deployment is complete the verticle should either call io.vertx.core.Promise#complete or io.vertx.core.Promise#fail the future.

Parameters
startPromise:Promise<Void>

the future

stopback to summary
public void stop(Promise<Void> stopPromise) throws Exception

Stop the verticle instance.

Vert.x calls this method when un-deploying the instance. You do not call it yourself.

A promise is passed into the method, and when un-deployment is complete the verticle should either call io.vertx.core.Promise#complete or io.vertx.core.Promise#fail the future.

Parameters
stopPromise:Promise<Void>

the future