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>
public final class CompletedFuture<T> extends Object implements org.jboss.threads.AsyncFuture<T>
An AsyncFuture that is inAsyncFuture.Status.COMPLETEas soon as it is instantiated.- Author:
- Brian Stansberry
-
-
Constructor Summary
Constructors Constructor Description CompletedFuture(T result)Creates a future that will provide the given value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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.Statusawait(long timeout, TimeUnit unit)org.jboss.threads.AsyncFuture.StatusawaitUninterruptibly()org.jboss.threads.AsyncFuture.StatusawaitUninterruptibly(long timeout, TimeUnit unit)booleancancel(boolean interruptionDesired)Tget()Tget(long timeout, TimeUnit unit)org.jboss.threads.AsyncFuture.StatusgetStatus()TgetUninterruptibly()TgetUninterruptibly(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()
-
-
-
Constructor Detail
-
CompletedFuture
public CompletedFuture(T result)
Creates a future that will provide the given value- Parameters:
result- the value
-
-
Method Detail
-
await
public org.jboss.threads.AsyncFuture.Status await() throws InterruptedException- 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
public T getUninterruptibly() throws CancellationException, ExecutionException
- 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
public org.jboss.threads.AsyncFuture.Status awaitUninterruptibly(long timeout, TimeUnit unit)- 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>
-
get
public T get() throws InterruptedException, ExecutionException
- 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
-
-