5 import jalview.datamodel.AlignmentAnnotation;
7 public interface AlignCalcManagerI
12 * tell manager that a worker is initialised and has started to run
15 void notifyStart(AlignCalcWorkerI worker);
18 * check if a calculation of this type is already active
22 boolean alreadyDoing(AlignCalcWorkerI worker);
25 * tell manager that worker is now processing data
28 boolean notifyWorking(AlignCalcWorkerI worker);
32 * notify manager that the worker has completed, and results may be ready to collect
35 void workerComplete(AlignCalcWorkerI worker);
38 * indicate that a worker like this cannot run on the platform and shouldn't be started again
41 void workerCannotRun(AlignCalcWorkerI worker);
44 * indicate that a worker like this may be run on the platform.
45 * @param worker of class to be removed from the execution blacklist
47 void workerMayRun(AlignCalcWorkerI worker);
52 void startWorker(AlignCalcWorkerI worker);
59 boolean isWorking(AlignCalcWorkerI worker);
62 * if any worker thread is operational, return true!
69 * register a restartable worker
72 void registerWorker(AlignCalcWorkerI worker);
75 * restart any registered workers
77 void restartWorkers();
81 * @param alignmentAnnotation
82 * @return true if a currently registered and working worker indicates its involvement with the given alignmentAnnotation
84 boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
87 * kick any known instances of the given worker class to update their annotation
90 void updateAnnotationFor(Class workerClass);
93 * return any registered workers of the given class
95 * @return null or one or more workers of the given class
97 List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
101 * start any workers of the given class
103 * @return false if no workers of given class were registered
104 * (note - blacklisted classes cannot be restarted, so this method will return true for blacklisted workers)
106 boolean startRegisteredWorkersOfClass(Class workerClass);