net.tomp2p.futures
Class FutureAsyncTask
java.lang.Object
net.tomp2p.futures.BaseFutureImpl<FutureAsyncTask>
net.tomp2p.futures.FutureAsyncTask
- All Implemented Interfaces:
- BaseFuture, Cancellable
public class FutureAsyncTask
- extends BaseFutureImpl<FutureAsyncTask>
A future to keep track of a future task. The task is submitted using an RPC, then a scheduled task keeps polling the
peer if the peer is still alive. If the peer dies, this future is notified. If the remote peer finishes the task, the
remote peer sends an RPC to the initiating peer that the task is finished.
- Author:
- Thomas Bocek
Methods inherited from class net.tomp2p.futures.BaseFutureImpl |
addCancellation, addListener, addListener, await, await, awaitListeners, awaitUninterruptibly, awaitUninterruptibly, cancel, getFailedReason, getType, isCompleted, isFailed, isSuccess, notifyListerenrs, removeListener, self, setCompletedAndNotify, setFailed, setFailed, setFailed, setFailed, setFailed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FutureAsyncTask
public FutureAsyncTask(PeerAddress remotePeer)
- Constructor
- Parameters:
remotePeer
- The address of the peer that processes the task
setDataMap
public void setDataMap(Map<Number160,Data> dataMap)
- Finishes the future and notifies listeners.
- Parameters:
dataMap
- The result from the remote peer
getDataMap
public Map<Number160,Data> getDataMap()
- Returns:
- The result of the remote peer from the task.
getRemotePeer
public PeerAddress getRemotePeer()
- Returns:
- The address of the peer that processes the task
Copyright © 2013. All Rights Reserved.