private static CancellationException cancellationExceptionWithCause( @Nullable String message, @Nullable Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; } }
private static CancellationException cancellationExceptionWithCause( @NullableDecl String message, @NullableDecl Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; } }
private static CancellationException cancellationExceptionWithCause( @NullableDecl String message, @NullableDecl Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; } }
private static CancellationException cancellationExceptionWithCause( @NullableDecl String message, @NullableDecl Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; } }
static final CancellationException cancellationExceptionWithCause( @Nullable String message, @Nullable Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; } }
@Override public C get() throws InterruptedException, ExecutionException { _latch.await(); if (_cause==COMPLETED) return _result; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
@Override public Void get() throws InterruptedException, ExecutionException { _latch.await(); if (_cause==COMPLETED) return null; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
private static CancellationException cancellationExceptionWithCause( @Nullable String message, @Nullable Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; }
@Override public C get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!_latch.await(timeout,unit)) throw new TimeoutException(); if (_cause==COMPLETED) return _result; if (_cause instanceof TimeoutException) throw (TimeoutException)_cause; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
@Override public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!_latch.await(timeout,unit)) throw new TimeoutException(); if (_cause==COMPLETED) return null; if (_cause instanceof TimeoutException) throw (TimeoutException)_cause; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
private static CancellationException cancellationExceptionWithCause( Throwable cause) { CancellationException exception = new CancellationException("Task was cancelled."); exception.initCause(cause); return exception; }
private static CancellationException cancellationExceptionWithCause( Throwable cause) { CancellationException exception = new CancellationException("Task was cancelled."); exception.initCause(cause); return exception; }
static final CancellationException cancellationExceptionWithCause( @Nullable String message, @Nullable Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); return exception; } }
@Override public Void get() throws InterruptedException, ExecutionException { _latch.await(); if (_cause == COMPLETED) return null; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
@Override public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!_latch.await(timeout, unit)) throw new TimeoutException(); if (_cause == COMPLETED) return null; if (_cause instanceof TimeoutException) throw (TimeoutException) _cause; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
@Override public C get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!_latch.await(timeout, unit)) throw new TimeoutException(); if (_cause == COMPLETED) return _result; if (_cause instanceof TimeoutException) throw (TimeoutException) _cause; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
@Override public C get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!_latch.await(timeout, unit)) throw new TimeoutException(); if (_cause == COMPLETED) return _result; if (_cause instanceof TimeoutException) throw (TimeoutException) _cause; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
@Override public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!_latch.await(timeout, unit)) throw new TimeoutException(); if (_cause == COMPLETED) return null; if (_cause instanceof TimeoutException) throw (TimeoutException) _cause; if (_cause instanceof CancellationException) throw (CancellationException) new CancellationException().initCause(_cause); throw new ExecutionException(_cause); }
private ContentResponse getResult() throws ExecutionException { if (isCancelled()) throw (CancellationException)new CancellationException().initCause(failure); if (failure != null) throw new ExecutionException(failure); return response; } }
private static <T> T join(final Future<T> future) { try { return future.get(); } catch (InterruptedException e) { throw (CancellationException)new CancellationException(e.getMessage()) .initCause(e); } catch (ExecutionException e) { throw new CompletionException(e); } }