listExpression = aListExpression;
}
- public void produce(Map aValueMap, String aVerb, LoggerWrapper aLogger) throws ProducerFailure, ProducerExc {
+ public void produce(ProductionContext aProductionContext) throws ProducerFailure, ProducerExc {
Iterator browser;
Object list;
try {
- list = ParameterExpander.evaluateExpression(aValueMap, listExpression);
+ list = ParameterExpander.evaluateExpression(aProductionContext.getValueSet(), listExpression);
if (list != null) {
- if (list instanceof Collection)
+ if (list instanceof Collection) {
browser = ( (Collection) list).iterator();
- else if (list instanceof Iterator)
+ }
+ else if (list instanceof Iterator) {
browser = (Iterator) list;
- else
+ }
+ else {
throw new ProducerExc("Can't enumarate a " + list.getClass().getName());
+ }
if (browser instanceof RewindableIterator) {
- ( (RewindableIterator) browser).rewind();
+ ((RewindableIterator) browser).rewind();
}
- while (browser.hasNext() && !isAborted(aValueMap)) {
- ParameterExpander.setValueForKey(aValueMap, key, browser.next());
- super.produce(aValueMap, aVerb, aLogger);
+ while (browser.hasNext() && !isAborted(aProductionContext)) {
+ ParameterExpander.setValueForKey(aProductionContext.getValueSet(), key, browser.next());
+
+ super.produce(aProductionContext);
}
}
}
catch (Throwable t) {
- aLogger.error("Exception occurred inside an ListEnumeratingProducerNode: " + t.getMessage());
+ aProductionContext.getLogger().warn("Exception occurred inside an ListEnumeratingProducerNode", t);
}
}
}