Change the way to deal with Limits to simplify wrapper writing and enable couping...
[jabaws.git] / runner / compbio / runner / disorder / Jronn.java
index 617d3bb..3f668e3 100644 (file)
@@ -34,8 +34,6 @@ import compbio.data.sequence.UnknownFileFormatException;
 import compbio.engine.client.CommandBuilder;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
-import compbio.metadata.Limit;\r
-import compbio.metadata.LimitsManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.runner.Util;\r
 \r
@@ -59,9 +57,6 @@ public class Jronn extends SkeletalExecutable<Jronn> {
 \r
        private final String ncorePrm = "-n=";\r
 \r
-       // Cache for Limits information\r
-       private static LimitsManager<Jronn> limits;\r
-\r
        public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
        public static final String STAT_FILE = "stat.txt";\r
 \r
@@ -132,40 +127,10 @@ public class Jronn extends SkeletalExecutable<Jronn> {
                return this;\r
        }\r
 \r
+       @SuppressWarnings("unchecked")\r
        @Override\r
-       public Limit<Jronn> getLimit(String presetName) {\r
-               if (limits == null) {\r
-                       limits = getLimits();\r
-               }\r
-               Limit<Jronn> 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<Jronn> 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 Class<? extends Executable<?>> getType() {\r
-               return this.getClass();\r
+       public Class<Executable<Jronn>> getType() {\r
+               return (Class<Executable<Jronn>>) this.getClass();\r
        }\r
 \r
        public static String getStatFile() {\r