X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws2%2FPollableTaskListenerI.java;h=d69b2d9a51448a39ee1985b05da62cf61d165460;hb=2bbba7f7426314bfd6a1f206861542244b5f511a;hp=e5a3682d7dd2dfede5ac674db718f2aa5d46ef2f;hpb=158e0595615ae4bfb13554f41f03b570642f6bb2;p=jalview.git diff --git a/src/jalview/ws2/PollableTaskListenerI.java b/src/jalview/ws2/PollableTaskListenerI.java index e5a3682..d69b2d9 100644 --- a/src/jalview/ws2/PollableTaskListenerI.java +++ b/src/jalview/ws2/PollableTaskListenerI.java @@ -1,14 +1,57 @@ package jalview.ws2; +/** + * Classes listening to the pollable task events must implement + * {@link PollableTaskListenerI}. They can be added to the + * {@link PollingTaskExecutor} to respond to the task execution events. + * + * @author mmwarowny + * + */ public interface PollableTaskListenerI { + /** + * Called when a new task is submitted for execution after its + * {@link PollableTask#start} method was called successfully. + * + * @param task + * submitted task + */ public void submitted(PollableTaskI task); + /** + * Called when a new task failed to start and raised an uncaught exception. + * + * @param task + * task that failed + * @param e + * raised exception + */ public void submissionFailed(PollableTaskI task, Exception e); + /** + * Called when polling resulted in an uncaught exception. + * + * @param task + * task that failed + * @param e + * raised exception + */ public void pollFailed(PollableTaskI task, Exception e); + /** + * Called when a task is cancelled. + * + * @param task + * cancelled task + */ public void cancelled(PollableTaskI task); + /** + * Called when the task finished execution either successfully or not. + * + * @param task + * finished task + */ public void done(PollableTaskI task); }