X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fapi%2FAlignCalcManagerI.java;h=35374c5525777332ea2367c9488216f0c8a87635;hb=7ef02aa7c7559f3a37f2f0524243c52b00335294;hp=e310696523fe6c177e731bec85399b9ad2d8f7c5;hpb=61df2ddd377ad0171a6d203fb9db2e1fa8ba5be6;p=jalview.git diff --git a/src/jalview/api/AlignCalcManagerI.java b/src/jalview/api/AlignCalcManagerI.java index e310696..35374c5 100644 --- a/src/jalview/api/AlignCalcManagerI.java +++ b/src/jalview/api/AlignCalcManagerI.java @@ -1,9 +1,14 @@ package jalview.api; +import java.util.List; + +import jalview.datamodel.AlignmentAnnotation; +import jalview.ws.jws2.AAConsClient; + public interface AlignCalcManagerI { - + /** * tell manager that a worker is initialised and has started to run * @param worker @@ -37,13 +42,18 @@ public interface AlignCalcManagerI 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 + */ + void workerMayRun(AlignCalcWorkerI worker); + /** * launch a new worker * @param worker */ void startWorker(AlignCalcWorkerI worker); /** - * + * * @param worker * @return */ @@ -55,4 +65,61 @@ public interface AlignCalcManagerI */ boolean isWorking(); + + /** + * register a restartable worker + * @param worker + */ + void registerWorker(AlignCalcWorkerI worker); + + /** + * restart any registered workers + */ + void restartWorkers(); + + /** + * + * @param 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 + * @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); + + /** + * 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) + */ + 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); + }