Example usage for io.vertx.core Future succeededFuture

List of usage examples for io.vertx.core Future succeededFuture

Introduction

In this page you can find the example usage for io.vertx.core Future succeededFuture.

Prototype

static <T> Future<T> succeededFuture(T result) 

Source Link

Document

Created a succeeded future with the specified result.

Usage

From source file:se.liquidbytes.jel.system.impl.JelServiceImpl.java

License:Apache License

@Override
public void listInstalledPlugins(Handler<AsyncResult<JsonArray>> resultHandler) {
    try {//from   w  w  w  .  j  a v a 2 s  .  c  om
        List<PluginDesc> plugins = JelService.pluginManager().getInstalledPlugins();

        JsonArray list = new JsonArray();
        plugins.stream().forEach((plugin) -> {
            list.add(plugin.toApi());
        });

        resultHandler.handle(Future.succeededFuture(list));
    } catch (Exception ex) {
        resultHandler.handle(Future.failedFuture(ex.getMessage()));
    }
}

From source file:se.liquidbytes.jel.system.impl.JelServiceImpl.java

License:Apache License

@Override
public void listAvailableAdapterTypes(Handler<AsyncResult<JsonArray>> resultHandler) {
    try {//from   w  ww .  j a v  a 2s  .co m
        List<PluginDesc> adapterTypes = JelService.adapterManager().getAvailableAdapterTypes();

        JsonArray list = new JsonArray();
        adapterTypes.stream().forEach((adapterType) -> {
            list.add(adapterType.toApi());
        });

        resultHandler.handle(Future.succeededFuture(list));
    } catch (Exception ex) {
        resultHandler.handle(Future.failedFuture(ex.getMessage()));
    }
}