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/proposal/myrmidon/src/java/org/apache/myrmidon/listeners AbstractProjectListener.java
Date Sun, 30 Dec 2001 07:32:09 GMT
donaldp     01/12/29 23:32:09

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/listeners
                        AbstractProjectListener.java
  Log:
  Refactor AbstractProjectListener so that it retains state regarding current task and current
target
  
  Revision  Changes    Path
  1.4       +33 -3     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java
  
  Index: AbstractProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractProjectListener.java	23 Dec 2001 06:25:37 -0000	1.3
  +++ AbstractProjectListener.java	30 Dec 2001 07:32:09 -0000	1.4
  @@ -16,6 +16,16 @@
       implements ProjectListener
   {
       /**
  +     * This contains the name of the current target.
  +     */
  +    private String m_target;
  +
  +    /**
  +     * This contains the name of the current task.
  +     */
  +    private String m_task;
  +
  +    /**
        * Notify listener of projectStarted event.
        */
       public void projectStarted()
  @@ -34,8 +44,9 @@
        *
        * @param targetName the name of target
        */
  -    public void targetStarted( final String targetName )
  +    public void targetStarted( final String target )
       {
  +        m_target = target;
       }
   
       /**
  @@ -43,15 +54,17 @@
        */
       public void targetFinished()
       {
  +        m_target = null;
       }
   
       /**
        * Notify listener of taskStarted event.
        *
  -     * @param taskName the name of task
  +     * @param task the name of task
        */
  -    public void taskStarted( final String taskName )
  +    public void taskStarted( final String task )
       {
  +        m_task = task;
       }
   
       /**
  @@ -59,6 +72,7 @@
        */
       public void taskFinished()
       {
  +        m_task = null;
       }
   
       /**
  @@ -78,5 +92,21 @@
        */
       public void log( String message, Throwable throwable )
       {
  +    }
  +
  +    /**
  +     * Utility method to get the name of current target.
  +     */
  +    protected final String getTarget()
  +    {
  +        return m_target;
  +    }
  +
  +    /**
  +     * Utility method to get the name of current task.
  +     */
  +    protected final String getTask()
  +    {
  +        return m_task;
       }
   }
  
  
  

--
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