JAL-3878 Add javadocs to created classes and reformat code.
[jalview.git] / src / jalview / ws2 / WebServiceWorkerListener.java
1 package jalview.ws2;
2
3 /**
4  * The listener interface for receiving signals from the
5  * {@link WebServiceWorkerI} about the state changes or new sub-jobs spawned.
6  * 
7  * The {@link WebServiceWorkerListener} objects created from that interface are
8  * then registered with a worker objects using
9  * {@link WebServiceWorkerI#addListener} method. When an event occurs, a
10  * relevant method in the listener is invoked with the worker that emitted the
11  * signal as a first parameter and, optionally, followed by additional event
12  * details.
13  * 
14  * @author mmwarowny
15  *
16  */
17 public interface WebServiceWorkerListener
18 {
19   /**
20    * Called when the worker started successfully.
21    * 
22    * @param source
23    *          worker that emitted the signal
24    */
25   void workerStarted(WebServiceWorkerI source);
26
27   /**
28    * Called when the worker failed to start the jobs.
29    * 
30    * @param source
31    *          worker that emitted the signal
32    */
33   void workerNotStarted(WebServiceWorkerI source);
34
35   /**
36    * Called when the worker creates a new job
37    * 
38    * @param source
39    *          worker that emitted the signal
40    * @param job
41    *          newly created job
42    */
43   void jobCreated(WebServiceWorkerI source, WSJob job);
44
45   /**
46    * Called when polling the job results in an exception.
47    * 
48    * @param source
49    *          worker that emitted the signal
50    * @param job
51    *          polled job
52    * @param e
53    *          exception that occurred
54    */
55   void pollException(WebServiceWorkerI source, WSJob job, Exception e);
56
57   /**
58    * Called when the polling has finished and the finalization process begun.
59    * 
60    * @param source
61    *          worker that emitted the signal
62    */
63   void workerCompleting(WebServiceWorkerI source);
64
65   /**
66    * Called when the worker completes its work.
67    * 
68    * @param source
69    *          worker that emitted the signal
70    */
71   void workerCompleted(WebServiceWorkerI source);
72 }