ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/event TaskEventManager.java
Date Thu, 04 Jul 2002 08:20:54 GMT
donaldp     2002/07/04 01:20:54

  Modified:    container/src/java/org/apache/myrmidon/components/event
                        DefaultTaskEventManager.java
               container/src/java/org/apache/myrmidon/interfaces/event
                        TaskEventManager.java
  Log:
  Make services "scoped"
  
  Revision  Changes    Path
  1.6       +32 -1     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/event/DefaultTaskEventManager.java
  
  Index: DefaultTaskEventManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/event/DefaultTaskEventManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultTaskEventManager.java	27 Jun 2002 05:13:34 -0000	1.5
  +++ DefaultTaskEventManager.java	4 Jul 2002 08:20:54 -0000	1.6
  @@ -26,6 +26,17 @@
   {
       private final List m_listenerList = new ArrayList();
       private TaskListener[] m_listeners = new TaskListener[ 0 ];
  +    private final TaskEventManager m_parent;
  +
  +    public DefaultTaskEventManager()
  +    {
  +        this( null );
  +    }
  +
  +    public DefaultTaskEventManager( final TaskEventManager parent )
  +    {
  +        m_parent = parent;
  +    }
   
       /**
        * Add an extra project listener that wants to receive notification of listener events.
  @@ -60,6 +71,11 @@
           {
               m_listeners[ i ].taskStarting( event );
           }
  +
  +        if( null != m_parent )
  +        {
  +            fireTaskStarting( event );
  +        }
       }
   
       /**
  @@ -71,6 +87,11 @@
           {
               m_listeners[ i ].taskFinished( event );
           }
  +
  +        if( null != m_parent )
  +        {
  +            fireTaskFinished( event );
  +        }
       }
   
       /**
  @@ -82,5 +103,15 @@
           {
               m_listeners[ i ].taskMessage( event );
           }
  +
  +        if( null != m_parent )
  +        {
  +            fireTaskMessage( event );
  +        }
  +    }
  +
  +    public TaskEventManager createChild()
  +    {
  +        return new DefaultTaskEventManager( this );
       }
   }
  
  
  
  1.4       +6 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/event/TaskEventManager.java
  
  Index: TaskEventManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/event/TaskEventManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TaskEventManager.java	5 Jun 2002 07:40:40 -0000	1.3
  +++ TaskEventManager.java	4 Jul 2002 08:20:54 -0000	1.4
  @@ -16,7 +16,6 @@
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @version $Revision$ $Date$
  - * @todo Move fire* methods to a separate service
    */
   public interface TaskEventManager
   {
  @@ -50,4 +49,9 @@
        * Fire a taskFinished event.
        */
       void fireTaskMessage( TaskEvent event );
  +
  +    /**
  +     * Create a child TaskEventManager.
  +     */
  +    TaskEventManager createChild();
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message