Package org.jboss.as.controller.remote
Class CompletedFuture<T>
java.lang.Object
org.jboss.as.controller.remote.CompletedFuture<T>
- All Implemented Interfaces:
Future<T>,org.jboss.threads.AsyncCancellable,org.jboss.threads.AsyncFuture<T>
An AsyncFuture that is in
AsyncFuture.Status.COMPLETE as soon as it is instantiated.- Author:
- Brian Stansberry
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCompletedFuture(T result) Creates a future that will provide the given value -
Method Summary
Modifier and TypeMethodDescription<A> voidaddListener(org.jboss.threads.AsyncFuture.Listener<? super T, A> listener, A attachment) voidasyncCancel(boolean interruptionDesired) org.jboss.threads.AsyncFuture.Statusawait()org.jboss.threads.AsyncFuture.Statusorg.jboss.threads.AsyncFuture.Statusorg.jboss.threads.AsyncFuture.StatusawaitUninterruptibly(long timeout, TimeUnit unit) booleancancel(boolean interruptionDesired) get()org.jboss.threads.AsyncFuture.StatusgetUninterruptibly(long timeout, TimeUnit unit) booleanbooleanisDone()
-
Constructor Details
-
CompletedFuture
Creates a future that will provide the given value- Parameters:
result- the value
-
-
Method Details
-
await
- Specified by:
awaitin interfaceorg.jboss.threads.AsyncFuture<T>- Throws:
InterruptedException
-
await
public org.jboss.threads.AsyncFuture.Status await(long timeout, TimeUnit unit) throws InterruptedException - Specified by:
awaitin interfaceorg.jboss.threads.AsyncFuture<T>- Throws:
InterruptedException
-
getUninterruptibly
- Specified by:
getUninterruptiblyin interfaceorg.jboss.threads.AsyncFuture<T>- Throws:
CancellationExceptionExecutionException
-
getUninterruptibly
public T getUninterruptibly(long timeout, TimeUnit unit) throws CancellationException, ExecutionException, TimeoutException - Specified by:
getUninterruptiblyin interfaceorg.jboss.threads.AsyncFuture<T>- Throws:
CancellationExceptionExecutionExceptionTimeoutException
-
awaitUninterruptibly
public org.jboss.threads.AsyncFuture.Status awaitUninterruptibly()- Specified by:
awaitUninterruptiblyin interfaceorg.jboss.threads.AsyncFuture<T>
-
awaitUninterruptibly
- Specified by:
awaitUninterruptiblyin interfaceorg.jboss.threads.AsyncFuture<T>
-
getStatus
public org.jboss.threads.AsyncFuture.Status getStatus()- Specified by:
getStatusin interfaceorg.jboss.threads.AsyncFuture<T>
-
addListener
public <A> void addListener(org.jboss.threads.AsyncFuture.Listener<? super T, A> listener, A attachment) - Specified by:
addListenerin interfaceorg.jboss.threads.AsyncFuture<T>
-
cancel
public boolean cancel(boolean interruptionDesired) -
asyncCancel
public void asyncCancel(boolean interruptionDesired) - Specified by:
asyncCancelin interfaceorg.jboss.threads.AsyncCancellable- Specified by:
asyncCancelin interfaceorg.jboss.threads.AsyncFuture<T>
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-