protected static class DefaultExecutorService.DistributedRunnableFuture<V> extends Object implements RunnableFuture<V>, NotifyingNotifiableFuture<V>
| Constructor and Description |
|---|
DefaultExecutorService.DistributedRunnableFuture(DistributedExecuteCommand<V> command)
Creates a DistributedRunnableFuture that will upon running, execute the given
Runnable, and arrange that get will return the given result on successful
completion.
|
| Modifier and Type | Method and Description |
|---|---|
NotifyingFuture<V> |
attachListener(FutureListener<V> listener)
Attaches a listener and returns the same future instance, to allow for 'building'.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
boolean |
equals(Object o) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
DistributedExecuteCommand<V> |
getCommand() |
int |
hashCode() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
notifyDone() |
void |
run() |
void |
setNetworkFuture(Future<V> future) |
public DefaultExecutorService.DistributedRunnableFuture(DistributedExecuteCommand<V> command)
runnable - the runnable taskresult - the result to return on successful completion.public DistributedExecuteCommand<V> getCommand()
public boolean isCancelled()
isCancelled in interface Future<V>public boolean cancel(boolean mayInterruptIfRunning)
public V get() throws InterruptedException, ExecutionException
get in interface Future<V>InterruptedExceptionExecutionExceptionpublic V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<V>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic void run()
run in interface Runnablerun in interface RunnableFuture<V>public void notifyDone()
notifyDone in interface NotifyingNotifiableFuture<V>public NotifyingFuture<V> attachListener(FutureListener<V> listener)
NotifyingFutureattachListener in interface NotifyingFuture<V>listener - listener to attachpublic void setNetworkFuture(Future<V> future)
setNetworkFuture in interface NotifyingNotifiableFuture<V>Copyright © 2012 JBoss by Red Hat. All Rights Reserved.