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

handlebars.JavaVertXServer.MainApiVerticle.mustache Maven / Gradle / Ivy

There is a newer version: 1.0.54
Show newest version
package {{rootPackage}};

{{#rxInterface}}
import io.reactivex.Completable;
import io.vertx.reactivex.core.AbstractVerticle;
{{/rxInterface}}
{{^rxInterface}}
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
{{/rxInterface}}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MainApiVerticle extends AbstractVerticle {
    static final Logger LOGGER = LoggerFactory.getLogger(MainApiVerticle.class);

    @Override
    {{^rxInterface}}public void start(Promise startPromise) throws Exception {
    vertx.deployVerticle("{{verticlePackage}}.{{title}}Verticle")
      .onFailure(error -> {
        LOGGER.error("{{title}}Verticle : Deployment failed");
        startPromise.fail(error);
      })
      .onSuccess(server -> {
        LOGGER.info("{{title}}Verticle : Deployed");
        startPromise.complete();
      });
    }{{/rxInterface}}
    {{#rxInterface}}public Completable rxStart() {
      return vertx.rxDeployVerticle("{{verticlePackage}}.{{title}}Verticle")
        .doOnError(error -> LOGGER.error("{{title}}Verticle : Deployment failed"))
        .doOnSuccess(server -> LOGGER.info("{{title}}Verticle : Deployed"))
        .ignoreElement();
    }{{/rxInterface}}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy