JAL-1116 - location where vamsas sync failure occurs
[jalview.git] / src / jalview / api / AlignCalcManagerI.java
index e310696..1eedc74 100644 (file)
@@ -1,9 +1,13 @@
 package jalview.api;
 
+import java.util.List;
+
+import jalview.datamodel.AlignmentAnnotation;
+
 public interface AlignCalcManagerI
 {
 
-  
+
   /**
    * tell manager that a worker is initialised and has started to run
    * @param worker
@@ -37,13 +41,18 @@ public interface AlignCalcManagerI
   void workerCannotRun(AlignCalcWorkerI worker);
 
   /**
+   * indicate that a worker like this may be run on the platform.
+   * @param worker of class to be removed from the execution blacklist
+   */
+  void workerMayRun(AlignCalcWorkerI worker);
+  /**
    * launch a new worker
    * @param worker
    */
   void startWorker(AlignCalcWorkerI worker);
 
   /**
-   * 
+   *
    * @param worker
    * @return
    */
@@ -55,4 +64,55 @@ public interface AlignCalcManagerI
    */
   boolean isWorking();
 
+
+  /**
+   * register a restartable worker
+   * @param worker
+   */
+  void registerWorker(AlignCalcWorkerI worker);
+
+  /**
+   * restart any registered workers
+   */
+  void restartWorkers();
+
+  /**
+   *
+   * @param alignmentAnnotation
+   * @return true if a currently registered and working worker indicates its involvement with the given alignmentAnnotation
+   */
+  boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
+
+  /**
+   * kick any known instances of the given worker class to update their annotation
+   * @param workerClass
+   */
+  void updateAnnotationFor(Class workerClass);
+
+  /**
+   * return any registered workers of the given class
+   * @param workerClass
+   * @return null or one or more workers of the given class
+   */
+  List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
+          Class workerClass);
+
+  /**
+   * start any workers of the given class
+   * @param workerClass
+   * @return false if no workers of given class were registered
+   * (note - blacklisted classes cannot be restarted, so this method will return true for blacklisted workers)
+   */
+  boolean startRegisteredWorkersOfClass(Class workerClass);
+
+  /**
+   * work out if there is an instance of a worker that is *waiting* to start
+   * calculating
+   *
+   * @param workingClass
+   * @return true if workingClass is already waiting to calculate. false if it
+   *         is calculating, or not queued.
+   */
+  boolean isPending(AlignCalcWorkerI workingClass);
+
 }