org.infinispan.distexec
Class DefaultExecutorService.DistributedRunnableFuture<V>
java.lang.Object
org.infinispan.distexec.DefaultExecutorService.DistributedRunnableFuture<V>
- All Implemented Interfaces:
- Runnable, Future<V>, RunnableFuture<V>, NotifyingFuture<V>, NotifyingNotifiableFuture<V>
- Enclosing class:
- DefaultExecutorService
protected static class DefaultExecutorService.DistributedRunnableFuture<V>
- extends Object
- implements RunnableFuture<V>, NotifyingNotifiableFuture<V>
DistributedRunnableFuture is essentially a Future wrap around DistributedExecuteCommand.
- Author:
- Mircea Markus, Vladimir Blagojevic
DefaultExecutorService.DistributedRunnableFuture
public 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.
- Parameters:
runnable
- the runnable taskresult
- the result to return on successful completion.
getCommand
public DistributedExecuteCommand<V> getCommand()
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface Future<V>
isDone
public boolean isDone()
- Specified by:
isDone
in interface Future<V>
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface Future<V>
get
public V get()
throws InterruptedException,
ExecutionException
- Specified by:
get
in interface Future<V>
- Throws:
InterruptedException
ExecutionException
get
public V get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get
in interface Future<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
run
public void run()
- Specified by:
run
in interface Runnable
- Specified by:
run
in interface RunnableFuture<V>
notifyDone
public void notifyDone()
- Specified by:
notifyDone
in interface NotifyingNotifiableFuture<V>
attachListener
public NotifyingFuture<V> attachListener(FutureListener<V> listener)
- Description copied from interface:
NotifyingFuture
- Attaches a listener and returns the same future instance, to allow for 'building'.
- Specified by:
attachListener
in interface NotifyingFuture<V>
- Parameters:
listener
- listener to attach
- Returns:
- the same future instance
setNetworkFuture
public void setNetworkFuture(Future<V> future)
- Specified by:
setNetworkFuture
in interface NotifyingNotifiableFuture<V>
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.