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

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
 List<K> getAll()
           
 String getFailedReason()
          The default failed reason is Unknown.
 K getLast()
           
 int getSuccessCounter()
           
protected  boolean setFinish(K last, BaseFuture.FutureType type)
           
 
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

setFinish

protected boolean setFinish(K last,
                            BaseFuture.FutureType type)

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()

getAll

public List<K> getAll()

getSuccessCounter

public int getSuccessCounter()


Copyright © 2011. All Rights Reserved.