X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmir%2Fproducer%2FNodedProducer.java;fp=source%2Fmir%2Fproducer%2FNodedProducer.java;h=946d28d39c7e8301ae4d4eb9c39cea32b16627c9;hb=c9ac8fa71b679f8d967aac901bbef945c13b94c9;hp=e4f3da1e6755192f36f752ec1d8512d2c0b16573;hpb=d63595f89aaa4b6a524dc0b4af9e0eef888f4c6b;p=mir.git diff --git a/source/mir/producer/NodedProducer.java b/source/mir/producer/NodedProducer.java index e4f3da1e..946d28d3 100755 --- a/source/mir/producer/NodedProducer.java +++ b/source/mir/producer/NodedProducer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001, 2002 The Mir-coders group + * Copyright (C) 2001-2006 The Mir-coders group * * This file is part of Mir. * @@ -19,8 +19,6 @@ * * In addition, as a special exception, The Mir-coders gives permission to link * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), * and distribute linked combinations including the two. You must obey the * GNU General Public License in all respects for all of the code used other than * the above mentioned libraries. If you modify this file, you may extend this @@ -29,42 +27,35 @@ */ package mir.producer; -import java.util.HashMap; -import java.util.Map; - -import mir.log.LoggerWrapper; +/** + *

A NodedProducer is the root of a tree of ProducerNodes.

+ * + *

There used to be a time when there were Producers that weren't + * NodedProducers, however they have been phased out.

+ */ public class NodedProducer implements Producer { private ProducerNode rootNode; - private String verb; - private Map baseValues; private boolean isAborted; private boolean isFinished; protected final static String PRODUCER_KEY = "$producer"; - public NodedProducer( ProducerNode aRootNode, String aVerb, Map aBaseValues) { + public NodedProducer(ProducerNode aRootNode) { rootNode = aRootNode; - verb = aVerb; - baseValues = aBaseValues; isAborted = false; } - public boolean produce( LoggerWrapper aLogger ) throws ProducerFailure, ProducerExc { - Map valueMap; - - valueMap = new HashMap(); - valueMap.putAll(baseValues); - valueMap.put(PRODUCER_KEY, this); - - rootNode.produce(valueMap, verb, aLogger); + public boolean execute(ProductionContext aProductionContext) throws ProducerFailure, ProducerExc { + rootNode.produce(aProductionContext); synchronized(this) { isFinished=true; + return !isAborted; } - }; + } - public void abort() { + public void abort(ProductionContext aContext) { synchronized(this) { if (!isFinished) isAborted=true; @@ -76,10 +67,4 @@ public class NodedProducer implements Producer { return isAborted; } } - - public boolean getIsFinished() { - synchronized(this) { - return isFinished; - } - } }