Change the way to deal with Limits to simplify wrapper writing and enable couping...
[jabaws.git] / engine / compbio / engine / client / SkeletalExecutable.java
index b289f6c..19fde7e 100644 (file)
@@ -293,11 +293,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