public class WaitForAllListener<T> extends Object implements AsyncFutureListener<T>
waitForResult()
. The number of executions needs to be known in advance and set in the
constructor.Constructor and Description |
---|
WaitForAllListener(int numberOfResults)
Constructs a new listener with the number of executions this listener will be set on.
|
WaitForAllListener(int numberOfResults,
AsyncFutureListener<T> listener)
Constructs a new listener with the number of executions this listener will be set on with an
optional delegate listener.
|
Modifier and Type | Method and Description |
---|---|
void |
onResult(AsyncResult<T> result)
A callback when a result of an async invocation arrives.
|
Future<T>[] |
waitForResult()
Waits for all the results indefently.
|
Future<T>[] |
waitForResult(long timeout,
TimeUnit unit)
Waits for all the results for the given time period.
|
public WaitForAllListener(int numberOfResults)
public WaitForAllListener(int numberOfResults, AsyncFutureListener<T> listener)
public void onResult(AsyncResult<T> result)
AsyncFutureListener
onResult
in interface AsyncFutureListener<T>
public Future<T>[] waitForResult() throws InterruptedException
InterruptedException
public Future<T>[] waitForResult(long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
Copyright © GigaSpaces.