|
GigaSpaces XAP 8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.core.executor.support.WaitForAnyListener<T>
public class WaitForAnyListener<T>
A listener that can be used to set on several execution and then wait
for any of the results (using waitForResult()
. The number of executions
needs to be known in advance and set in the constructor.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WaitForAnyListener(int numberOfResults)
public WaitForAnyListener(int numberOfResults, AsyncFutureListener<T> listener)
Method Detail |
---|
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
|
GigaSpaces XAP 8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |