com.hazelcast.core
Class DistributedTask<V>
java.lang.Object
java.util.concurrent.FutureTask<V>
com.hazelcast.core.DistributedTask<V>
- All Implemented Interfaces:
- Runnable, Future<V>, RunnableFuture<V>
- Direct Known Subclasses:
- MultiTask
public class DistributedTask<V>
- extends FutureTask<V>
A cancellable asynchronous distributed computation.
This class is analogue to java.util.concurrent.FutureTask.
Once the computation has completed, the computation cannot
be restarted or cancelled.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributedTask
public DistributedTask(Callable<V> callable)
DistributedTask
public DistributedTask(Callable<V> callable,
Member member)
DistributedTask
protected DistributedTask(Callable<V> callable,
Set<Member> members)
DistributedTask
public DistributedTask(Callable<V> callable,
Object key)
DistributedTask
public DistributedTask(Runnable task,
V result)
get
public V get()
throws InterruptedException,
ExecutionException
- Specified by:
get
in interface Future<V>
- Overrides:
get
in class FutureTask<V>
- Throws:
InterruptedException
ExecutionException
get
public V get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get
in interface Future<V>
- Overrides:
get
in class FutureTask<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
set
protected void set(V value)
- Overrides:
set
in class FutureTask<V>
setExecutionCallback
public void setExecutionCallback(ExecutionCallback<V> executionCallback)
getExecutionCallback
public ExecutionCallback<V> getExecutionCallback()
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface Future<V>
- Overrides:
isCancelled
in class FutureTask<V>
isDone
public boolean isDone()
- Specified by:
isDone
in interface Future<V>
- Overrides:
isDone
in class FutureTask<V>
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface Future<V>
- Overrides:
cancel
in class FutureTask<V>
setMemberLeft
protected void setMemberLeft(Member member)
getInner
public Object getInner()
callable
public static <V> Callable<V> callable(Runnable task,
V result)
onResult
protected void onResult(V result)
Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.