JAL-3878 Add javadocs to created classes and reformat code.
[jalview.git] / src / jalview / ws2 / PollableTaskListenerI.java
index e5a3682..d69b2d9 100644 (file)
@@ -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);
 }