@Override public void onFailure(final Throwable ex) { if (ex instanceof Exception) { resultFuture.setException(COMMIT_EX_MAPPER.apply((Exception)ex)); } else { resultFuture.setException(ex); } } }, MoreExecutors.directExecutor());
return (X) input.getCause(); return newWithCause(opName + " execution failed", input.getCause()); return newWithCause(opName + " was interupted.", input); return newWithCause(opName + " was cancelled.", input); return newWithCause(opName + " encountered an unexpected failure", input);
return (X) input.getCause(); return newWithCause(opName + " execution failed", input.getCause()); return newWithCause(opName + " was interupted.", input); return newWithCause(opName + " was cancelled.", input); return newWithCause(opName + " encountered an unexpected failure", input);
@Override public T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (result != null) { return result.orElse(null); } try { return transformIfNecessary(delegate.get(timeout, unit)); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), exMapper.apply(e)); } }
@Override public DOMRpcResult get(@Nonnull final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (result != null) { return result; } try { return transformIfNecessary(bindingFuture.get(timeout, unit)); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), DOM_RPC_EX_MAPPER.apply(e)); } }
@Override public T get() throws InterruptedException, ExecutionException { if (result != null) { return result.orElse(null); } try { return transformIfNecessary(delegate.get()); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), exMapper.apply(e)); } }
@Override @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE") public DOMRpcResult checkedGet() throws DOMRpcException { try { return get(); } catch (InterruptedException | ExecutionException e) { throw LEGACY_DOM_RPC_EX_MAPPER.apply(e); } }
@Override @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE") public DOMRpcResult checkedGet(final long timeout, final TimeUnit unit) throws TimeoutException, DOMRpcException { try { return get(timeout, unit); } catch (InterruptedException | ExecutionException e) { throw LEGACY_DOM_RPC_EX_MAPPER.apply(e); } }
@Override public DOMRpcResult get() throws InterruptedException, ExecutionException { if (result != null) { return result; } try { return transformIfNecessary(bindingFuture.get()); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), DOM_RPC_EX_MAPPER.apply(e)); } }
@Override public DOMRpcResult get() throws InterruptedException, ExecutionException { if (result != null) { return result; } try { return transformIfNecessary(bindingFuture.get()); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), DOM_RPC_EX_MAPPER.apply(e)); } }
@Override public DOMActionResult get(@Nonnull final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (result != null) { return result; } try { return transformIfNecessary(bindingFuture.get(timeout, unit)); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), DOM_ACTION_EX_MAPPER.apply(e)); } }
@Override public DOMRpcResult get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (result != null) { return result; } try { return transformIfNecessary(bindingFuture.get(timeout, unit)); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), DOM_RPC_EX_MAPPER.apply(e)); } }
@Override public DOMActionResult get() throws InterruptedException, ExecutionException { if (result != null) { return result; } try { return transformIfNecessary(bindingFuture.get()); } catch (ExecutionException e) { throw new ExecutionException(e.getMessage(), DOM_ACTION_EX_MAPPER.apply(e)); } }
@Override @SuppressWarnings("rawtypes") public void onTransactionChainFailed(final org.opendaylight.mdsal.dom.api.DOMTransactionChain chain, final DOMDataTreeTransaction transaction, final Throwable cause) { listener.onTransactionChainFailed(legacyChain.get(), (AsyncTransaction) () -> transaction.getIdentifier(), cause instanceof Exception ? COMMIT_EX_MAPPER.apply((Exception)cause) : cause); }