|
barchart-util-concurrent 2.0.16 / 2012-12-19T12:07:36.441-0600 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.barchart.util.concurrent.FutureCallbackList<E>
E - The deferred result typepublic class FutureCallbackList<E>
Groups a number of FutureCallbackTask results together, and executes
a single callback only after all FutureCallbacks have completed (succeeded or
failed.)
This class does not support direct access to succeed() or fail(), and will
throw and UnsupportedOperationException for them.
FutureCallbackTask| Constructor Summary | |
|---|---|
FutureCallbackList(List<? extends FutureCallback<E,?>> results_)
Create a FutureCallbackList from the specified FutureCallback objects. |
|
| Method Summary | |
|---|---|
FutureCallbackList<E> |
addResultListener(FutureListener<List<E>> callback)
Add a callback listener that will be called when all FutureCallbacks have completed. |
boolean |
cancel(boolean interrupt)
|
FutureCallbackList<E> |
fail(Throwable error)
Notify listeners that an error occurred. |
List<E> |
get()
|
List<E> |
get(long timeout,
TimeUnit unit)
|
List<E> |
getUnchecked()
Get the return value, or null if a checked exception was caught. |
boolean |
isCancelled()
|
boolean |
isDone()
|
FutureCallbackList<E> |
succeed(List<E> result)
Notify listeners that a result is available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FutureCallbackList(List<? extends FutureCallback<E,?>> results_)
deferreds_ - The list of deferred results to monitor| Method Detail |
|---|
public FutureCallbackList<E> addResultListener(FutureListener<List<E>> callback)
addResultListener in interface FutureCallback<List<E>,FutureCallbackList<E>>callback - The object to notify of the deferred resultspublic boolean cancel(boolean interrupt)
cancel in interface Future<List<E>>public List<E> get()
get in interface Future<List<E>>public List<E> getUnchecked()
FutureCallback
getUnchecked in interface FutureCallback<List<E>,FutureCallbackList<E>>
public List<E> get(long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
get in interface Future<List<E>>InterruptedException
TimeoutExceptionpublic boolean isCancelled()
isCancelled in interface Future<List<E>>public boolean isDone()
isDone in interface Future<List<E>>public FutureCallbackList<E> succeed(List<E> result)
FutureCallbackreturn new FutureCallbackTask
succeed in interface FutureCallback<List<E>,FutureCallbackList<E>>public FutureCallbackList<E> fail(Throwable error)
FutureCallbackreturn new FutureCallbackTask
fail in interface FutureCallback<List<E>,FutureCallbackList<E>>
|
barchart-util-concurrent 2.0.16 / 2012-12-19T12:07:36.441-0600 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||