mafft new location
[jabaws.git] / engine / compbio / engine / client / SkeletalExecutable.java
index b289f6c..f974302 100644 (file)
@@ -42,9 +42,13 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
        // Cache for Limits information\r
        private LimitsManager<T> limits;\r
 \r
-       protected String inputFile = "input.txt";\r
-       protected String outputFile = "output.txt";\r
-       protected String errorFile = "error.txt";\r
+       public static final String INPUT = "input.txt";\r
+       public static final String OUTPUT = "result.txt";\r
+       public static final String ERROR = "error.txt";\r
+\r
+       protected String inputFile = INPUT;\r
+       protected String outputFile = OUTPUT;\r
+       protected String errorFile = ERROR;\r
 \r
        private boolean isInputSet = false;\r
        private boolean isOutputSet = false;\r
@@ -293,11 +297,16 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
        }\r
 \r
        @Override\r
-       public Limit<T> getLimit(String presetName) {\r
-\r
+       public synchronized Limit<T> getLimit(String presetName) {\r
+               // Assume this function is called for the first time and thus need\r
+               // initialization\r
                if (limits == null) {\r
                        limits = getLimits();\r
                }\r
+               // Either the initialization failed or limits were not configured.\r
+               if (limits == null) {\r
+                       return null;\r
+               }\r
 \r
                Limit<T> limit = null;\r
                if (limits != null) {\r
@@ -318,7 +327,7 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
        public LimitsManager<T> getLimits() {\r
                synchronized (SkeletalExecutable.class) {\r
                        if (limits == null) {\r
-                               limits = compbio.runner.Util.getLimits(this.getType());\r
+                               limits = compbio.engine.client.Util.getLimits(this.getType());\r
                        }\r
                }\r
                return limits;\r
@@ -328,6 +337,6 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
         * \r
         * @return subclasses must return their type\r
         */\r
-       public abstract Class<Executable<T>> getType();\r
+       public abstract Class<T> getType();\r
 \r
 }\r