Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 48971 invoked from network); 23 Apr 2002 07:41:16 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 23 Apr 2002 07:41:16 -0000 Received: (qmail 3580 invoked by uid 97); 23 Apr 2002 07:41:17 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 3559 invoked by uid 97); 23 Apr 2002 07:41:17 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 3541 invoked by uid 97); 23 Apr 2002 07:41:16 -0000 Date: 23 Apr 2002 07:41:15 -0000 Message-ID: <20020423074115.14567.qmail@icarus.apache.org> From: donaldp@apache.org To: jakarta-ant-myrmidon-cvs@apache.org Subject: cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace DefaultExecutionFrame.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N donaldp 02/04/23 00:41:15 Modified: container/src/java/org/apache/myrmidon/components/workspace DefaultExecutionFrame.java Log: Implement the new ExecutionFrame interface. Note that when partitioning that the TaskEventManager is not properly partitioned (ie it isn't at alll at the moment) Revision Changes Path 1.7 +82 -4 jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultExecutionFrame.java Index: DefaultExecutionFrame.java =================================================================== RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultExecutionFrame.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DefaultExecutionFrame.java 9 Apr 2002 02:26:35 -0000 1.6 +++ DefaultExecutionFrame.java 23 Apr 2002 07:41:14 -0000 1.7 @@ -8,7 +8,9 @@ package org.apache.myrmidon.components.workspace; import org.apache.avalon.framework.logger.Logger; +import org.apache.avalon.framework.service.DefaultServiceManager; import org.apache.avalon.framework.service.ServiceManager; +import org.apache.myrmidon.interfaces.event.TaskEventManager; import org.apache.myrmidon.interfaces.executor.ExecutionFrame; import org.apache.myrmidon.interfaces.property.PropertyStore; @@ -16,22 +18,40 @@ * Frames in which tasks are executed. * * @author Peter Donald - * @version $Revision: 1.6 $ $Date: 2002/04/09 02:26:35 $ + * @version $Revision: 1.7 $ $Date: 2002/04/23 07:41:14 $ */ public class DefaultExecutionFrame implements ExecutionFrame { + private final String m_name; private final Logger m_logger; private final PropertyStore m_propertyStore; private final ServiceManager m_serviceManager; + private final TaskEventManager m_eventManager; - public DefaultExecutionFrame( final Logger logger, + public DefaultExecutionFrame( final String name, + final Logger logger, final PropertyStore propertyStore, - final ServiceManager serviceManager ) + final ServiceManager serviceManager, + final TaskEventManager eventManager ) { + m_name = name; m_logger = logger; m_propertyStore = propertyStore; m_serviceManager = serviceManager; + m_eventManager = eventManager; + } + + /** + * Returns the name of the execution frame. + * This is used when generating TaskEvents as the + * "path" element. + * + * @return the name of execution frame + */ + public String getName() + { + return m_name; } /** @@ -54,8 +74,66 @@ /** * Returns the set of properties to be supplied to tasks. */ - public PropertyStore getProperties() + public PropertyStore getPropertyStore() { return m_propertyStore; + } + + /** + * Returns the {@link TaskEventManager} that can be used to fire events + * or to register listeners. + */ + public TaskEventManager getTaskEventManager() + { + return m_eventManager; + } + + /** + * Create a child execution frame. + * + * @param name the name of child frame relative to current frame + * @param partition true if frame is partition frame + * @return the new child ExecutionFrame + * @see ExecutionFrame#createChildFrame + */ + public ExecutionFrame createChildFrame( final String name, + final boolean partition ) + { + if( !partition ) + { + final String newName = m_name + "/" + name; + return new DefaultExecutionFrame( newName, + m_logger, + m_propertyStore, + m_serviceManager, + m_eventManager ); + } + else + { + return createPartitionedFrame( name ); + } + } + + /** + * Create a partitioned pane so that modifications of child + * elements does not effect parent objects. + * + * @param name the relative name of frame + * @return the partiioned frame that is created + */ + private ExecutionFrame createPartitionedFrame( final String name ) + { + final String newName = m_name + "/" + name; + final Logger logger = m_logger.getChildLogger( name ); + final PropertyStore propertyStore = + m_propertyStore.createChildStore( name ); + final DefaultServiceManager serviceManager = + new DefaultServiceManager( m_serviceManager ); + + return new DefaultExecutionFrame( newName, + logger, + propertyStore, + serviceManager, + m_eventManager ); } } -- To unsubscribe, e-mail: For additional commands, e-mail: