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/api/src/java/org/apache/myrmidon/api/event TaskListener.java TaskEvent.java
Date Sat, 20 Apr 2002 23:05:47 GMT
donaldp     02/04/20 16:05:47

  Added:       api/src/java/org/apache/myrmidon/api/event TaskListener.java
                        TaskEvent.java
  Log:
  Start to integrate the TaskEvent stuff
  
  Revision  Changes    Path
  1.1                  jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/event/TaskListener.java
  
  Index: TaskListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.api.event;
  
  /**
   * Use the TaskListener interface to receive {@link TaskEvent}
   * notifications about tasks.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/04/20 23:05:47 $
   */
  public interface TaskListener
  {
      /**
       * Notify the listener that the task is starting.
       * This is called prior to task starting.
       *
       * @param event the TaskEvent
       */
      void taskStarting( TaskEvent event );
  
      /**
       * Notify the listener that the task logged
       * a message.
       *
       * @param event the TaskEvent
       */
      void taskMessage( TaskEvent event );
  
      /**
       * Notify the listener that the task has finished.
       * This is called after task has finished.
       *
       * @param event the TaskEvent
       */
      void taskFinished( TaskEvent event );
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/event/TaskEvent.java
  
  Index: TaskEvent.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.api.event;
  
  /**
   * The TaskEvent object notifies {@link TaskListener} objects
   * when a {@link org.apache.myrmidon.api.Task} starts, stops
   * or logs a message via the
   * {@link org.apache.myrmidon.api.TaskContext}.
   *
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/04/20 23:05:47 $
   */
  public final class TaskEvent
  {
      /**
       * The path to task. A path is made of of 0 or more elements.
       * Each element in path is separated by a '/' character. An
       * example path is "/myproject/mytarget".
       */
      private final String m_path;
  
      /**
       * The name of the task that inititiated event.
       */
      private final String m_name;
  
      /**
       * The location of task definition in the physical medium
       * it is stored in. (ie "build.xml:20:4")
       */
      private final String m_location;
  
      /**
       * The message associated with event (if any).
       */
      private final String m_message;
  
      /**
       * The throwable associated with event (if any).
       */
      private final Throwable m_throwable;
  
      /**
       * The processID associated with event (TBD).
       */
      private final int m_processID;
  
      public TaskEvent( final String path
                        final String name,
                        final String location,
                        final String message,
                        final Throwable throwable,
                        final int processID )
      {
          m_path = path;
          m_name = name;
          m_location = location;
          m_message = message;
          m_throwable = throwable;
          m_processID = processID;
  
          if( null == path )
          {
              throw new NullPointerException( "path" );
          }
          if( null == name )
          {
              throw new NullPointerException( "name" );
          }
          if( null == location )
          {
              throw new NullPointerException( "location" );
          }
      }
  
      /**
       * Retrieve the path to task that this event is about.
       *
       * @return the path to task
       * @see #m_path
       */
      public String getPath()
      {
          return m_path;
      }
  
      /**
       * Retrieve the name of task that this event is about.
       *
       * @return the name of task
       * @see #m_name
       */
      public String getName()
      {
          return m_name;
      }
  
      /**
       * Retrieve the location of task that this event is about.
       *
       * @return the location of task
       * @see #m_location
       */
      public String getLocation()
      {
          return m_location;
      }
  
      /**
       * Retrieve the message (if any) associated with event.
       *
       * @return the message
       * @see #m_message
       */
      public String getMessage()
      {
          return m_message;
      }
  
      /**
       * Retrieve the throwable (if any) associated with event.
       *
       * @return the throwable
       * @see #m_throwable
       */
      public Throwable getThrowable()
      {
          return m_throwable;
      }
  
      /**
       * Retrieve the processID in which task is executing.
       *
       * @return the processID
       * @see #m_processID
       */
      public int getProcessID()
      {
          return m_processID;
      }
  }
  
  
  

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