Class CompoundFuture<T,R>
java.lang.Object
com.gigaspaces.async.internal.CompoundFuture<T,R>
- All Implemented Interfaces:
AsyncFuture<R>, AsyncFutureListener<T>, Future<R>
a future implementation used to aggregate results from multiple Futures. it uses a call back from
the single Futures to determine whether the action has completed.
- Since:
- 6.5
- Author:
- asy ronen
-
Nested Class Summary
Nested classes/interfaces inherited from interface Future
Future.State -
Constructor Summary
ConstructorsConstructorDescriptionCompoundFuture(AsyncFuture<T>[] futures, AsyncResultsReducer<T, R> reducer) CompoundFuture(AsyncFuture<T>[] futures, AsyncResultsReducer<T, R> reducer, AsyncResultFilter<T> moderator) -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) get()booleanbooleanisDone()voidonResult(AsyncResult<T> result) A callback when a result of an async invocation arrives.voidsetListener(AsyncFutureListener<R> listener) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Future
exceptionNow, resultNow, state
-
Constructor Details
-
CompoundFuture
-
CompoundFuture
public CompoundFuture(AsyncFuture<T>[] futures, AsyncResultsReducer<T, R> reducer, AsyncResultFilter<T> moderator)
-
-
Method Details
-
setListener
- Specified by:
setListenerin interfaceAsyncFuture<T>
-
cancel
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
-
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public R get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
onResult
Description copied from interface:AsyncFutureListenerA callback when a result of an async invocation arrives.- Specified by:
onResultin interfaceAsyncFutureListener<T>
-