Refine search
private T getResult() throws ExecutionException { if (this.ex != null) { throw new ExecutionException(this.ex); } if (cancelled) { throw new CancellationException(); } return this.result; }
private T getResult() throws ExecutionException { if (this.ex != null) { throw new ExecutionException(this.ex); } if (cancelled) { throw new CancellationException(); } return this.result; }
private V getOrThrowExecutionException() throws ExecutionException { assert (result != null || exception != null || cancelled); if (result != null) { return result; } if (exception != null) { throw new ExecutionException(exception); } assert (cancelled); throw new CancellationException(); }
/** * Returns result or throws exception for completed task. * * @param s completed state value */ @SuppressWarnings("unchecked") private V report(int s) throws ExecutionException { Object x = outcome; if (s == NORMAL) return (V)x; if (s >= CANCELLED) throw new CancellationException(); throw new ExecutionException((Throwable)x); }
V innerGet(long nanosTimeout) throws InterruptedException, ExecutionException, TimeoutException { if (!tryAcquireSharedNanos(0, nanosTimeout)) throw new TimeoutException(); if (getState() == CANCELLED) throw new CancellationException(); if (exception != null) throw new ExecutionException(exception); return result; }
@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
V innerGet() throws InterruptedException, ExecutionException { acquireSharedInterruptibly(0); if (getState() == CANCELLED) throw new CancellationException(); if (exception != null) throw new ExecutionException(exception); return result; }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { throw new TimeoutException(timeoutMessage(timeout, unit)); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { throw new TimeoutException(timeoutMessage(timeout, unit)); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
throw new CancellationException(); } else if (loadFailed) { throw new ExecutionException(exception); } else if (resultReceived) { return resource; throw new InterruptedException(); } else if (loadFailed) { throw new ExecutionException(exception); } else if (isCancelled) { throw new CancellationException(); } else if (!resultReceived) { throw new TimeoutException();
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { throw new TimeoutException(timeoutMessage(timeout, unit)); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { throw new TimeoutException(); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get() throws InterruptedException, ExecutionException { switch (state) { case S_READY: try { result = run(); state = S_DONE; } catch (Exception e) { error = e; if (e instanceof InterruptedException) { throw (InterruptedException) e; } throw new ExecutionException(e); } finally { if (state != S_DONE) { state = S_ERROR; } } return result; case S_DONE: return result; case S_ERROR: throw new ExecutionException(error); case S_CANCELED: throw new CancellationException(); default: throw DbException.throwInternalError("" + state); } }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { throw new TimeoutException(); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { throw new TimeoutException(); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
/** {@inheritDoc} */ @Override public T get() throws ExecutionException { try { T res = fut.get(); if (fut.isCancelled()) throw new CancellationException("Task was cancelled: " + fut); return res; } catch (IgniteCheckedException e) { // Task cancellation may cause throwing exception. if (fut.isCancelled()) { RuntimeException ex = new CancellationException("Task was cancelled: " + fut); ex.initCause(e); throw ex; } throw new ExecutionException("Failed to get task result: " + fut, e); } }
@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { BlockingHelper.verifyNonBlocking(); await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }