public class WaitForAnyListener<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 |
---|
WaitForAnyListener(int numberOfResults)
Constructs a new listener with the number of executions this listener will be set on.
|
WaitForAnyListener(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.
|
T |
waitForResult()
Waits for any result indefently.
|
T |
waitForResult(long timeout,
TimeUnit unit)
Waits for any result for the given time period.
|
public WaitForAnyListener(int numberOfResults)
public WaitForAnyListener(int numberOfResults, AsyncFutureListener<T> listener)
public void onResult(AsyncResult<T> result)
AsyncFutureListener
onResult
in interface AsyncFutureListener<T>
public T waitForResult() throws InterruptedException
InterruptedException
public T waitForResult(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
Copyright © GigaSpaces.