@Override public void failed(final ProcessingException error) { try { if (error.getCause() instanceof WebApplicationException) { responseFuture.completeExceptionally(error.getCause()); } else if (!responseFuture.isCancelled()) { responseFuture.completeExceptionally(error); } } finally { callback.failed(error.getCause() instanceof CancellationException ? error.getCause() : error); } } };
@Override public void failed(final ProcessingException error) { try { if (error.getCause() instanceof WebApplicationException) { responseFuture.completeExceptionally(error.getCause()); } else if (!responseFuture.isCancelled()) { responseFuture.completeExceptionally(error); } } finally { callback.failed(error.getCause() instanceof CancellationException ? error.getCause() : error); } } };
@Override public void failed(final ProcessingException error) { try { if (error.getCause() instanceof WebApplicationException) { responseFuture.completeExceptionally(error.getCause()); } else if (!responseFuture.isCancelled()) { responseFuture.completeExceptionally(error); } } finally { callback.failed(error.getCause() instanceof CancellationException ? error.getCause() : error); } } };
responseFuture.completeExceptionally(ce); callback.failed(ce);
responseFuture.completeExceptionally(ce); callback.failed(ce);
responseFuture.completeExceptionally(ce); callback.failed(ce);
@Override public void failed(Exception ex) { invocationCallback.failed(clientException(ex, null)); } }
private <T> void callFailedNoThrow(InvocationCallback<T> callback, Exception exception) { if (callback != null) { try { callback.failed(exception); } catch (Exception e) { //logger.error("ignoring exception in InvocationCallback", e); } } }
private void failed(Throwable t) { final RuntimeException x = clientException(t, cr); future.completeExceptionally(x); if (callback != null) { callback.failed(x); } } });
@Override public void cancelled() { invocationCallback.failed(new ProcessingException("cancelled")); }
future.completeExceptionally(e); if (callback != null) { callback.failed(e);
@Override public void handleException(Map<String, Object> ctx, final Throwable ex) { context = ctx; exception = ex; if (handler != null) { handler.failed(exception); } done = true; synchronized (this) { notifyAll(); } }
@Override public boolean cancel(boolean mayInterruptIfRunning) { boolean result = super.cancel(mayInterruptIfRunning); if (result && handler != null) { handler.failed(new CancellationException()); } return result; }
@Override public void cancelled() { invocationCallback.failed(new ProcessingException("cancelled")); }
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { try { return getObject(callback.get(timeout, unit)[0]); } catch (InterruptedException ex) { if (callback.handler != null) { callback.handler.failed(ex); } throw ex; } }
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { try { return getObject(callback.get(timeout, unit)[0]); } catch (InterruptedException ex) { if (callback.handler != null) { callback.handler.failed(ex); } throw ex; } }
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { try { return getObject(callback.get(timeout, unit)[0]); } catch (InterruptedException ex) { InvocationCallback<T> handler = callback.getHandler(); if (handler != null) { handler.failed(ex); } throw ex; } }
public T get() throws InterruptedException, ExecutionException { try { return getObject(callback.get()[0]); } catch (InterruptedException ex) { InvocationCallback<T> handler = callback.getHandler(); if (handler != null) { handler.failed(ex); } throw ex; } } public T get(long timeout, TimeUnit unit) throws InterruptedException,
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { try { return getObject(callback.get(timeout, unit)[0]); } catch (InterruptedException ex) { if (callback.handler != null) { callback.handler.failed(new ClientException((InterruptedException)ex)); } throw ex; } }
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { try { return getObject(callback.get(timeout, unit)[0]); } catch (InterruptedException ex) { InvocationCallback<T> handler = callback.getHandler(); if (handler != null) { handler.failed(ex); } throw ex; } }