2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.datamodel.AlignmentAnnotation;
25 import java.util.List;
27 public interface AlignCalcManagerI
31 * tell manager that a worker is initialised and has started to run
35 void notifyStart(AlignCalcWorkerI worker);
38 * tell manager that worker is now processing data
42 boolean notifyWorking(AlignCalcWorkerI worker);
45 * notify manager that the worker has completed, and results may be ready to
50 void workerComplete(AlignCalcWorkerI worker);
53 * indicate that a worker like this cannot run on the platform and shouldn't
58 void disableWorker(AlignCalcWorkerI worker);
61 * indicate that a worker like this may be run on the platform.
64 * of class to be removed from the execution blacklist
66 void enableWorker(AlignCalcWorkerI worker);
69 * Answers true if the worker is disabled from running
74 boolean isDisabled(AlignCalcWorkerI worker);
81 void startWorker(AlignCalcWorkerI worker);
88 boolean isWorking(AlignCalcWorkerI worker);
91 * if any worker thread is operational, return true!
98 * register a restartable worker
102 void registerWorker(AlignCalcWorkerI worker);
105 * restart any registered workers
107 void restartWorkers();
111 * @param alignmentAnnotation
112 * @return true if a currently registered and working worker indicates its
113 * involvement with the given alignmentAnnotation
115 boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
118 * kick any known instances of the given worker class to update their
123 void updateAnnotationFor(Class<? extends AlignCalcWorkerI> workerClass);
126 * return any registered workers of the given class
129 * @return null or one or more workers of the given class
131 List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
132 Class<? extends AlignCalcWorkerI> workerClass);
135 * work out if there is an instance of a worker that is *waiting* to start
138 * @param workingClass
139 * @return true if workingClass is already waiting to calculate. false if it
140 * is calculating, or not queued.
142 boolean isPending(AlignCalcWorkerI workingClass);
145 * deregister and otherwise remove any registered and working instances of the
148 * @param typeToRemove
150 void removeRegisteredWorkersOfClass(
151 Class<? extends AlignCalcWorkerI> typeToRemove);
154 * Removes the worker that produces the given annotation, provided it is
155 * marked as 'deletable'. Some workers may need to continue to run as the
156 * results of their calculations are needed, e.g. for colour schemes.
160 void removeWorkerForAnnotation(AlignmentAnnotation ann);