3 import jalview.datamodel.AlignmentAnnotation;
7 public interface AlignCalcManagerI
11 * 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
23 boolean alreadyDoing(AlignCalcWorkerI worker);
26 * tell manager that worker is now processing data
30 boolean notifyWorking(AlignCalcWorkerI worker);
33 * notify manager that the worker has completed, and results may be ready to
38 void workerComplete(AlignCalcWorkerI worker);
41 * indicate that a worker like this cannot run on the platform and shouldn't
46 void workerCannotRun(AlignCalcWorkerI worker);
49 * indicate that a worker like this may be run on the platform.
52 * of class to be removed from the execution blacklist
54 void workerMayRun(AlignCalcWorkerI worker);
61 void startWorker(AlignCalcWorkerI worker);
68 boolean isWorking(AlignCalcWorkerI worker);
71 * if any worker thread is operational, return true!
78 * register a restartable worker
82 void registerWorker(AlignCalcWorkerI worker);
85 * restart any registered workers
87 void restartWorkers();
91 * @param alignmentAnnotation
92 * @return true if a currently registered and working worker indicates its
93 * involvement with the given alignmentAnnotation
95 boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
98 * kick any known instances of the given worker class to update their
103 void updateAnnotationFor(Class workerClass);
106 * return any registered workers of the given class
109 * @return null or one or more workers of the given class
111 List<AlignCalcWorkerI> getRegisteredWorkersOfClass(Class workerClass);
114 * start any workers of the given class
117 * @return false if no workers of given class were registered (note -
118 * blacklisted classes cannot be restarted, so this method will return
119 * true for blacklisted workers)
121 boolean startRegisteredWorkersOfClass(Class workerClass);
124 * work out if there is an instance of a worker that is *waiting* to start
127 * @param workingClass
128 * @return true if workingClass is already waiting to calculate. false if it
129 * is calculating, or not queued.
131 boolean isPending(AlignCalcWorkerI workingClass);
134 * deregister and otherwise remove any registered and working instances of the
137 * @param typeToRemove
139 void removeRegisteredWorkersOfClass(Class typeToRemove);