X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FAlignCalcManagerI.java;h=0529198378d07f52e9b20de5e36244de8e663bf3;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=1eedc74cbb0488f913a9cf0064fb536fc8ec5b93;hpb=f61b2748a32ef03e687abc37b97640873c2e44aa;p=jalview.git diff --git a/src/jalview/api/AlignCalcManagerI.java b/src/jalview/api/AlignCalcManagerI.java index 1eedc74..0529198 100644 --- a/src/jalview/api/AlignCalcManagerI.java +++ b/src/jalview/api/AlignCalcManagerI.java @@ -1,21 +1,42 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.api; -import java.util.List; - import jalview.datamodel.AlignmentAnnotation; +import java.util.List; + public interface AlignCalcManagerI { - /** * tell manager that a worker is initialised and has started to run + * * @param worker */ void notifyStart(AlignCalcWorkerI worker); /** * check if a calculation of this type is already active + * * @param worker * @return */ @@ -23,36 +44,44 @@ public interface AlignCalcManagerI /** * tell manager that worker is now processing data + * * @param worker */ boolean notifyWorking(AlignCalcWorkerI worker); - /** - * notify manager that the worker has completed, and results may be ready to collect + * notify manager that the worker has completed, and results may be ready to + * collect + * * @param worker */ void workerComplete(AlignCalcWorkerI worker); /** - * indicate that a worker like this cannot run on the platform and shouldn't be started again + * indicate that a worker like this cannot run on the platform and shouldn't + * be started again + * * @param worker */ 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 + * + * @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 */ @@ -60,13 +89,14 @@ public interface AlignCalcManagerI /** * if any worker thread is operational, return true! + * * @return */ boolean isWorking(); - /** * register a restartable worker + * * @param worker */ void registerWorker(AlignCalcWorkerI worker); @@ -77,42 +107,55 @@ public interface AlignCalcManagerI void restartWorkers(); /** - * + * * @param alignmentAnnotation - * @return true if a currently registered and working worker indicates its involvement with the given 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 + * 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 getRegisteredWorkersOfClass( - Class workerClass); + List 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) + * @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); + /** + * deregister and otherwise remove any registered and working instances of the + * given worker type + * + * @param typeToRemove + */ + void removeRegisteredWorkersOfClass(Class typeToRemove); + }