Change the way to deal with Limits to simplify wrapper writing and enable couping...
[jabaws.git] / runner / compbio / runner / msa / Tcoffee.java
index 949c4f1..3b35875 100644 (file)
@@ -20,7 +20,6 @@ package compbio.runner.msa;
 \r
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
-import java.security.InvalidParameterException;\r
 import java.util.Arrays;\r
 import java.util.List;\r
 \r
@@ -34,22 +33,19 @@ import compbio.engine.client.Executable;
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.engine.conf.PropertyHelperManager;\r
-import compbio.metadata.Limit;\r
-import compbio.metadata.LimitsManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.runner.Util;\r
 import compbio.util.PropertyHelper;\r
 \r
-public class Tcoffee extends SkeletalExecutable<Tcoffee> implements\r
-PipedExecutable<Tcoffee>, ClusterNativeSpecExecutable<Tcoffee> {\r
+public class Tcoffee extends SkeletalExecutable<Tcoffee>\r
+               implements\r
+                       PipedExecutable<Tcoffee>,\r
+                       ClusterNativeSpecExecutable<Tcoffee> {\r
 \r
        private static Logger log = Logger.getLogger(Tcoffee.class);\r
 \r
        private static PropertyHelper ph = PropertyHelperManager\r
-       .getPropertyHelper();\r
-\r
-       // Cache for Limits information\r
-       private static LimitsManager<Tcoffee> limits;\r
+                       .getPropertyHelper();\r
 \r
        public static final String KEY_VALUE_SEPARATOR = "=";\r
 \r
@@ -88,7 +84,7 @@ PipedExecutable<Tcoffee>, ClusterNativeSpecExecutable<Tcoffee> {
        @SuppressWarnings("unchecked")\r
        @Override\r
        public Alignment getResults(String workDirectory)\r
-       throws ResultNotAvailableException {\r
+                       throws ResultNotAvailableException {\r
                try {\r
                        return Util.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
@@ -141,45 +137,13 @@ PipedExecutable<Tcoffee>, ClusterNativeSpecExecutable<Tcoffee> {
        }\r
 \r
        @Override\r
-       public Limit<Tcoffee> getLimit(String presetName) {\r
-               if (limits == null) {\r
-                       limits = getLimits();\r
-               }\r
-\r
-               Limit<Tcoffee> limit = null;\r
-               if (limits != null) {\r
-                       // this returns default limit if preset is undefined!\r
-                       limit = limits.getLimitByName(presetName);\r
-               }\r
-               // If limit is not defined for a particular preset, then return default\r
-               // limit\r
-               if (limit == null) {\r
-                       log.debug("Limit for the preset " + presetName\r
-                                       + " is not found. Using default");\r
-                       limit = limits.getDefaultLimit();\r
-               }\r
-               return limit;\r
-       }\r
-\r
-       @Override\r
-       public LimitsManager<Tcoffee> getLimits() {\r
-               // synchronise on static field\r
-               synchronized (log) {\r
-                       if (limits == null) {\r
-                               limits = Util.getLimits(this.getClass());\r
-                       }\r
-               }\r
-               return limits;\r
-       }\r
-\r
-       @Override\r
        public String getNativeSpecs() {\r
                return getClusterSettings();\r
        }\r
 \r
-\r
+       @SuppressWarnings("unchecked")\r
        @Override\r
-       public Class<? extends Executable<?>> getType() {\r
-               return this.getClass();\r
+       public Class<Executable<Tcoffee>> getType() {\r
+               return (Class<Executable<Tcoffee>>) this.getClass();\r
        }\r
 }\r