cleanup / abuse system fix / prepping for a release
[mir.git] / source / mir / producer / LoopProducerNode.java
index 5b56b04..387bc45 100755 (executable)
@@ -29,9 +29,6 @@
  */
 package mir.producer;
 
-import java.util.Map;
-
-import mir.log.LoggerWrapper;
 import mir.util.ParameterExpander;
 
 
@@ -49,23 +46,22 @@ public class LoopProducerNode extends ProducerNodeDecorator {
     condition = aCondition;
   }
 
-
-  public void produce(Map aValueMap, String aVerb, LoggerWrapper aLogger) throws ProducerFailure {
+  public void produce(ProductionContext aProductionContext) throws ProducerFailure {
     int loopNr;
     int maxNrLoops;
 
     try {
       loopNr = 0;
-      maxNrLoops = ParameterExpander.evaluateIntegerExpressionWithDefault(aValueMap, limit, 1000);
-      while (ParameterExpander.evaluateBooleanExpression(aValueMap, condition) &&
-             (loopNr<maxNrLoops) &&
-             !isAborted(aValueMap)) {
-        super.produce(aValueMap, aVerb, aLogger);
+      maxNrLoops = ParameterExpander.evaluateIntegerExpressionWithDefault(aProductionContext.getValueSet(), limit, 1000);
+      while (ParameterExpander.evaluateBooleanExpression(aProductionContext.getValueSet(), condition) &&
+             (loopNr<maxNrLoops) && !isAborted(aProductionContext)) {
+        super.produce(aProductionContext);
+
         loopNr++;
       }
     }
     catch (Throwable t) {
-      aLogger.error("LoopProducerNode raised an exception: " + t.getMessage());
+      aProductionContext.getLogger().warn("LoopProducerNode raised an exception", t);
     }
   }
 }
\ No newline at end of file