5 import jalview.datamodel.AlignmentAnnotation;
6 import jalview.ws.jws2.AAConsClient;
8 public interface AlignCalcManagerI
13 * tell manager that a worker is initialised and has started to run
16 void notifyStart(AlignCalcWorkerI worker);
19 * check if a calculation of this type is already active
23 boolean alreadyDoing(AlignCalcWorkerI worker);
26 * tell manager that worker is now processing data
29 boolean notifyWorking(AlignCalcWorkerI worker);
33 * notify manager that the worker has completed, and results may be ready to collect
36 void workerComplete(AlignCalcWorkerI worker);
39 * indicate that a worker like this cannot run on the platform and shouldn't be started again
42 void workerCannotRun(AlignCalcWorkerI worker);
45 * indicate that a worker like this may be run on the platform.
46 * @param worker of class to be removed from the execution blacklist
48 void workerMayRun(AlignCalcWorkerI worker);
53 void startWorker(AlignCalcWorkerI worker);
60 boolean isWorking(AlignCalcWorkerI worker);
63 * if any worker thread is operational, return true!
70 * register a restartable worker
73 void registerWorker(AlignCalcWorkerI worker);
76 * restart any registered workers
78 void restartWorkers();
82 * @param alignmentAnnotation
83 * @return true if a currently registered and working worker indicates its involvement with the given alignmentAnnotation
85 boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
88 * kick any known instances of the given worker class to update their annotation
91 void updateAnnotationFor(Class workerClass);
94 * return any registered workers of the given class
96 * @return null or one or more workers of the given class
98 List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
102 * start any workers of the given class
104 * @return false if no workers of given class were registered
105 * (note - blacklisted classes cannot be restarted, so this method will return true for blacklisted workers)
107 boolean startRegisteredWorkersOfClass(Class workerClass);
110 * work out if there is an instance of a worker that is *waiting* to start
113 * @param workingClass
114 * @return true if workingClass is already waiting to calculate. false if it
115 * is calculating, or not queued.
117 boolean isPending(AlignCalcWorkerI workingClass);
120 * deregister and otherwise remove any registered and working instances of the given worker type
121 * @param typeToRemove
123 void removeRegisteredWorkersOfClass(Class typeToRemove);