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>
InterruptedException
ExecutionException
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public void run()
run
in interface Runnable
run
in interface RunnableFuture<V>
public void notifyDone()
notifyDone
in interface NotifyingNotifiableFuture<V>
public NotifyingFuture<V> attachListener(FutureListener<V> listener)
NotifyingFuture
attachListener
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.