/** {@inheritDoc} */ @SuppressWarnings({ "unchecked" }) public final T getUninterruptibly(final long timeout, final TimeUnit unit) throws CancellationException, ExecutionException, TimeoutException { synchronized (AsyncFutureTask.this) { final Status status = awaitUninterruptibly(timeout, unit); switch (status) { case CANCELLED: throw Messages.msg.operationCancelled(); case FAILED: throw Messages.msg.operationFailed((Throwable) result); case COMPLETE: return (T) result; case WAITING: throw Messages.msg.operationTimedOut(); default: throw Assert.impossibleSwitchCase(status); } } }
/** {@inheritDoc} */ @SuppressWarnings({ "unchecked" }) public final T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { synchronized (AsyncFutureTask.this) { final Status status = await(timeout, unit); switch (status) { case CANCELLED: throw Messages.msg.operationCancelled(); case FAILED: throw Messages.msg.operationFailed((Throwable) result); case COMPLETE: return (T) result; case WAITING: throw Messages.msg.operationTimedOut(); default: throw Assert.impossibleSwitchCase(status); } } }
/** {@inheritDoc} */ @SuppressWarnings({ "unchecked" }) public final T getUninterruptibly(final long timeout, final TimeUnit unit) throws CancellationException, ExecutionException, TimeoutException { synchronized (AsyncFutureTask.this) { final Status status = awaitUninterruptibly(timeout, unit); switch (status) { case CANCELLED: throw Messages.msg.operationCancelled(); case FAILED: throw Messages.msg.operationFailed((Throwable) result); case COMPLETE: return (T) result; case WAITING: throw Messages.msg.operationTimedOut(); default: throw Assert.impossibleSwitchCase(status); } } }
/** {@inheritDoc} */ @SuppressWarnings({ "unchecked" }) public final T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { synchronized (AsyncFutureTask.this) { final Status status = await(timeout, unit); switch (status) { case CANCELLED: throw Messages.msg.operationCancelled(); case FAILED: throw Messages.msg.operationFailed((Throwable) result); case COMPLETE: return (T) result; case WAITING: throw Messages.msg.operationTimedOut(); default: throw Assert.impossibleSwitchCase(status); } } }
/** {@inheritDoc} */ @SuppressWarnings({ "unchecked" }) public final T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { synchronized (AsyncFutureTask.this) { final Status status = await(timeout, unit); switch (status) { case CANCELLED: throw Messages.msg.operationCancelled(); case FAILED: throw Messages.msg.operationFailed((Throwable) result); case COMPLETE: return (T) result; case WAITING: throw Messages.msg.operationTimedOut(); default: throw Assert.impossibleSwitchCase(status); } } }
/** {@inheritDoc} */ @SuppressWarnings({ "unchecked" }) public final T getUninterruptibly(final long timeout, final TimeUnit unit) throws CancellationException, ExecutionException, TimeoutException { synchronized (AsyncFutureTask.this) { final Status status = awaitUninterruptibly(timeout, unit); switch (status) { case CANCELLED: throw Messages.msg.operationCancelled(); case FAILED: throw Messages.msg.operationFailed((Throwable) result); case COMPLETE: return (T) result; case WAITING: throw Messages.msg.operationTimedOut(); default: throw Assert.impossibleSwitchCase(status); } } }