|
FutureTalker V1.3 by Matthew Ford 2005/04/11 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFutureListener<T>
Listener interface for FutureTalker
Method Summary | |
---|---|
void |
futureCancelled(java.util.concurrent.CancellationException cex,
FutureTalker<T> talker)
Called if cancelled. |
void |
futureError(java.lang.Throwable t,
FutureTalker<T> talker)
Called when the task's Callable.call() exits with an error. |
void |
futureResult(T result,
FutureTalker<T> talker)
Called on normal completion A call to this method implies the task's call() method has returned without throwing an error. |
Method Detail |
---|
void futureResult(T result, FutureTalker<T> talker)
result
- The result return by Callable.call()
talker
- the FutureTalker
that was run.void futureCancelled(java.util.concurrent.CancellationException cex, FutureTalker<T> talker)
Note: This method is NOT called if the task was
interrupted by some other means other than a
call to Future.cancel(boolean)
.
In particular a call to
ThreadPoolExecutor.shutdownNow()
does not call
Future.cancel(boolean)
on any of the queued or running tasks.
You need to provide a
RejectedExecutionHandler
and
override ThreadPoolExecutor.shutdownNow()
to call Future.cancel(boolean)
, if you want this
method to be called on rejection and shutdown.
talker
- the FutureTalker
that was run.cex
- the cancellation exception.void futureError(java.lang.Throwable t, FutureTalker<T> talker)
Callable.call()
exits with an error.
ExecutionException
return by a call to Future.get()
A call to this method implies the task's call()
method has exited with an error or that FutureTalker.rejected(java.util.concurrent.RejectedExecutionException)
was called.
t
- the error that cased the task to terminatetalker
- the FutureTalker
that was run.
|
©2004, Forward Computing and Control Pty. Ltd ACN 003 669 994 NSW Australia All Rights Reserved. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |