@Override public TaskExecutor getChildExecutor() { return getTaskExecutor(); }
protected final ChainedListenableFuture<Void> doAfter(ListenableFuture<?> first, final Runnable second) { return doAfter(getTaskExecutor(), first, second); }
protected final <V> ChainedListenableFuture<V> doAfter(ListenableFuture<V> first, final Callable<ListenableFuture<V>> second) { return doAfter(getTaskExecutor(), first, second); }
protected final <V,A> ChainedListenableFuture<V> doAfter(ListenableFuture<A> first, final CallableWithArgument<ListenableFuture<V>,A> second) { return doAfter(getTaskExecutor(), first, second); }
@Override public void performAction(final ConfiguredObject<?> child) { ListenableFuture<Void> childCloseFuture = child.closeAsync(); addFutureCallback(childCloseFuture, new FutureCallback<Void>() { @Override public void onSuccess(final Void result) { } @Override public void onFailure(final Throwable t) { LOGGER.error("Exception occurred while closing {} : {}", child.getClass().getSimpleName(), child.getName(), t); } }, getTaskExecutor()); childCloseFutures.add(childCloseFuture); } });
@Override public Void execute() { try { addFutureCallback(task.execute(), new FutureCallback<T>() { @Override public void onSuccess(final T result) { returnVal.set(result); } @Override public void onFailure(final Throwable t) { returnVal.setException(t); } }, getTaskExecutor()); } catch(Throwable t) { returnVal.setException(t); } return null; }
child.getClass().getSimpleName(), child.getName(), t); }, getTaskExecutor()); childDeleteFutures.add(childDeleteFuture); }); return Futures.transform(combinedFuture, input -> null, getTaskExecutor());
stateTransitionResult.setException(t); }, getTaskExecutor()); returnVal = stateTransitionResult;
protected static <V> ChainedListenableFuture<Void> doAfterAlways(Executor executor, ListenableFuture<V> future, final Runnable after) { final ChainedSettableFuture<Void> returnVal = new ChainedSettableFuture<Void>(executor); addFutureCallback(future, new FutureCallback<V>() { @Override public void onSuccess(final V result) { try { after.run(); returnVal.set(null); } catch (Throwable e) { returnVal.setException(e); } } @Override public void onFailure(final Throwable t) { try { after.run(); } finally {