All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arangodb.shaded.vertx.core.Verticle Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
/*
 * Copyright (c) 2011-2019 Contributors to the Eclipse Foundation
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
 * which is available at https://www.apache.org/licenses/LICENSE-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
 */

package com.arangodb.shaded.vertx.core;

/**
 * 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 {@link com.arangodb.shaded.vertx.core.eventbus.EventBus}. * * @author Tim Fox */ public interface Verticle { /** * Get a reference to the Vert.x instance that deployed this verticle * * @return A reference to the Vert.x instance */ Vertx getVertx(); /** * 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. * * @param vertx the Vert.x instance * @param context the context */ void init(Vertx vertx, Context context); /** * 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 * {@link com.arangodb.shaded.vertx.core.Promise#complete} or {@link com.arangodb.shaded.vertx.core.Promise#fail} the future. * * @param startPromise the future */ void start(Promise startPromise) 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 * {@link com.arangodb.shaded.vertx.core.Promise#complete} or {@link com.arangodb.shaded.vertx.core.Promise#fail} the future. * * @param stopPromise the future */ void stop(Promise stopPromise) throws Exception; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy