List of usage examples for io.vertx.core Future succeededFuture
static <T> Future<T> succeededFuture(T result)
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())); } }