Change the way to deal with Limits to simplify wrapper writing and enable couping...
[jabaws.git] / webservices / compbio / ws / server / AAConWS.java
index 095bc4e..8637af1 100644 (file)
@@ -51,6 +51,9 @@ public class AAConWS implements SequenceAnnotation<AACon> {
        private static final PresetManager<AACon> aaconPresets = Util\r
                        .getPresets(AACon.class);\r
 \r
+       private static final LimitsManager<AACon> limitMan = compbio.runner.Util\r
+                       .getLimits(new AACon().getType());\r
+\r
        ConfiguredExecutable<AACon> init(List<FastaSequence> sequences)\r
                        throws JobSubmissionException {\r
                AACon aacon = new AACon();\r
@@ -81,12 +84,16 @@ public class AAConWS implements SequenceAnnotation<AACon> {
 \r
        @Override\r
        public Limit<AACon> getLimit(String presetName) {\r
-               return new AACon().getLimit(presetName);\r
+               if (limitMan == null) {\r
+                       // Limit is not defined\r
+                       return null;\r
+               }\r
+               return limitMan.getLimitByName(presetName);\r
        }\r
 \r
        @Override\r
        public LimitsManager<AACon> getLimits() {\r
-               return new AACon().getLimits();\r
+               return limitMan;\r
        }\r
 \r
        @Override\r