public final class CompletedFuture<T> extends Object implements org.jboss.threads.AsyncFuture<T>
AsyncFuture.Status.COMPLETE as soon as it is instantiated.| Constructor and Description |
|---|
CompletedFuture(T result)
Creates a future that will provide the given value
|
| Modifier and Type | Method and Description |
|---|---|
<A> void |
addListener(org.jboss.threads.AsyncFuture.Listener<? super T,A> listener,
A attachment) |
void |
asyncCancel(boolean interruptionDesired) |
org.jboss.threads.AsyncFuture.Status |
await() |
org.jboss.threads.AsyncFuture.Status |
await(long timeout,
TimeUnit unit) |
org.jboss.threads.AsyncFuture.Status |
awaitUninterruptibly() |
org.jboss.threads.AsyncFuture.Status |
awaitUninterruptibly(long timeout,
TimeUnit unit) |
boolean |
cancel(boolean interruptionDesired) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
org.jboss.threads.AsyncFuture.Status |
getStatus() |
T |
getUninterruptibly() |
T |
getUninterruptibly(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public CompletedFuture(T result)
result - the valuepublic org.jboss.threads.AsyncFuture.Status await()
throws InterruptedException
await in interface org.jboss.threads.AsyncFuture<T>InterruptedExceptionpublic org.jboss.threads.AsyncFuture.Status await(long timeout,
TimeUnit unit)
throws InterruptedException
await in interface org.jboss.threads.AsyncFuture<T>InterruptedExceptionpublic T getUninterruptibly() throws CancellationException, ExecutionException
getUninterruptibly in interface org.jboss.threads.AsyncFuture<T>CancellationExceptionExecutionExceptionpublic T getUninterruptibly(long timeout, TimeUnit unit) throws CancellationException, ExecutionException, TimeoutException
getUninterruptibly in interface org.jboss.threads.AsyncFuture<T>CancellationExceptionExecutionExceptionTimeoutExceptionpublic org.jboss.threads.AsyncFuture.Status awaitUninterruptibly()
awaitUninterruptibly in interface org.jboss.threads.AsyncFuture<T>public org.jboss.threads.AsyncFuture.Status awaitUninterruptibly(long timeout,
TimeUnit unit)
awaitUninterruptibly in interface org.jboss.threads.AsyncFuture<T>public org.jboss.threads.AsyncFuture.Status getStatus()
getStatus in interface org.jboss.threads.AsyncFuture<T>public <A> void addListener(org.jboss.threads.AsyncFuture.Listener<? super T,A> listener, A attachment)
addListener in interface org.jboss.threads.AsyncFuture<T>public boolean cancel(boolean interruptionDesired)
public void asyncCancel(boolean interruptionDesired)
asyncCancel in interface org.jboss.threads.AsyncCancellableasyncCancel in interface org.jboss.threads.AsyncFuture<T>public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2020 JBoss by Red Hat. All rights reserved.