net.tomp2p.futures
Class FutureForkJoin<K extends BaseFuture>

java.lang.Object
  extended by net.tomp2p.futures.BaseFutureImpl
      extended by net.tomp2p.futures.FutureForkJoin<K>
All Implemented Interfaces:
BaseFuture, Cancellable
Direct Known Subclasses:
FutureForkedBroadcast

public class FutureForkJoin<K extends BaseFuture>
extends BaseFutureImpl
implements BaseFuture


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.tomp2p.futures.BaseFuture
BaseFuture.FutureType
 
Field Summary
 
Fields inherited from class net.tomp2p.futures.BaseFutureImpl
completed, lock, reason, type
 
Constructor Summary
FutureForkJoin(int nrFinishFuturesSuccess, boolean cancelFuturesOnFinish, K... forks)
           
FutureForkJoin(K... forks)
           
 
Method Summary
 K[] getAll()
           
 String getFailedReason()
          The default failed reason is Unknown.
 List<K> getIntermediateFutures()
          This is only safe to access is this future has completed!
 K getLast()
           
 int getSuccessCounter()
           
 
Methods inherited from class net.tomp2p.futures.BaseFutureImpl
addCancellation, addListener, await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, getType, isCompleted, isFailed, isSuccess, notifyListerenrs, removeCancellation, removeListener, setCompletedAndNotify, setFailed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.tomp2p.futures.BaseFuture
addCancellation, addListener, await, await, awaitUninterruptibly, awaitUninterruptibly, getType, isCompleted, isFailed, isSuccess, removeCancellation, removeListener, setFailed
 
Methods inherited from interface net.tomp2p.futures.Cancellable
cancel
 

Constructor Detail

FutureForkJoin

public FutureForkJoin(K... forks)

FutureForkJoin

public FutureForkJoin(int nrFinishFuturesSuccess,
                      boolean cancelFuturesOnFinish,
                      K... forks)
Parameters:
futureNr - Is the number of non-null futures. Its fail fast.
nrFinishFuturesSuccess -
forks -
Method Detail

getFailedReason

public String getFailedReason()
Description copied from interface: BaseFuture
The default failed reason is Unknown.

Specified by:
getFailedReason in interface BaseFuture
Overrides:
getFailedReason in class BaseFutureImpl
Returns:
Returns the reason why a future failed.

getLast

public K getLast()

getIntermediateFutures

public List<K> getIntermediateFutures()
This is only safe to access is this future has completed!

Returns:
The list of finished futures indexes before complete has been called. This does not include the last future index, which can be accessed using getLast().

getAll

public K[] getAll()

getSuccessCounter

public int getSuccessCounter()


Copyright © 2011. All Rights Reserved.