JAL-3878 Add javadocs to created classes and reformat code.
[jalview.git] / src / jalview / ws2 / PollableTaskListenerI.java
1 package jalview.ws2;
2
3 /**
4  * Classes listening to the pollable task events must implement
5  * {@link PollableTaskListenerI}. They can be added to the
6  * {@link PollingTaskExecutor} to respond to the task execution events.
7  * 
8  * @author mmwarowny
9  *
10  */
11 public interface PollableTaskListenerI
12 {
13   /**
14    * Called when a new task is submitted for execution after its
15    * {@link PollableTask#start} method was called successfully.
16    * 
17    * @param task
18    *          submitted task
19    */
20   public void submitted(PollableTaskI task);
21
22   /**
23    * Called when a new task failed to start and raised an uncaught exception.
24    * 
25    * @param task
26    *          task that failed
27    * @param e
28    *          raised exception
29    */
30   public void submissionFailed(PollableTaskI task, Exception e);
31
32   /**
33    * Called when polling resulted in an uncaught exception.
34    * 
35    * @param task
36    *          task that failed
37    * @param e
38    *          raised exception
39    */
40   public void pollFailed(PollableTaskI task, Exception e);
41
42   /**
43    * Called when a task is cancelled.
44    * 
45    * @param task
46    *          cancelled task
47    */
48   public void cancelled(PollableTaskI task);
49
50   /**
51    * Called when the task finished execution either successfully or not.
52    * 
53    * @param task
54    *          finished task
55    */
56   public void done(PollableTaskI task);
57 }