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/components/workspace DefaultTaskContext.java
Date Fri, 24 May 2002 04:19:02 GMT
donaldp     02/05/23 21:19:02

  Modified:    api/src/java/org/apache/myrmidon/api/event TaskEvent.java
               container/src/java/org/apache/myrmidon/components/workspace
                        DefaultTaskContext.java
  Log:
  LogLevels now carried in TaskEvent objects.
  
  Revision  Changes    Path
  1.4       +35 -9     jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/event/TaskEvent.java
  
  Index: TaskEvent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/event/TaskEvent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TaskEvent.java	23 Apr 2002 01:31:26 -0000	1.3
  +++ TaskEvent.java	24 May 2002 04:19:02 -0000	1.4
  @@ -15,7 +15,7 @@
    *
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/04/23 01:31:26 $
  + * @version $Revision: 1.4 $ $Date: 2002/05/24 04:19:02 $
    */
   public final class TaskEvent
   {
  @@ -48,6 +48,12 @@
       private final Throwable m_throwable;
   
       /**
  +     * The LogLevel associated with event. Must be present
  +     * if Throwable or Message is specified.
  +     */
  +    private LogLevel m_logLevel;
  +
  +    /**
        * The processID associated with event (TBD).
        */
       private final int m_processID;
  @@ -66,7 +72,7 @@
                         final String location,
                         final int processID )
       {
  -        this( path, name, location, null, null, processID );
  +        this( path, name, location, null, null, null, processID );
       }
   
       /**
  @@ -84,15 +90,9 @@
                         final String location,
                         final String message,
                         final Throwable throwable,
  +                      final LogLevel logLevel,
                         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" );
  @@ -105,6 +105,20 @@
           {
               throw new NullPointerException( "location" );
           }
  +
  +        if( null == logLevel &&
  +            ( null != message || null != throwable ) )
  +        {
  +            throw new NullPointerException( "logLevel" );
  +        }
  +
  +        m_path = path;
  +        m_name = name;
  +        m_location = location;
  +        m_message = message;
  +        m_throwable = throwable;
  +        m_logLevel = logLevel;
  +        m_processID = processID;
       }
   
       /**
  @@ -138,6 +152,18 @@
       public String getLocation()
       {
           return m_location;
  +    }
  +
  +    /**
  +     * Retrieve the LogLevel associated with event.
  +     * Always non-null if Message or Throwable non-null
  +     *
  +     * @return the level
  +     * @see #m_logLevel
  +     */
  +    public LogLevel getLogLevel()
  +    {
  +        return m_logLevel;
       }
   
       /**
  
  
  
  1.48      +7 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java
  
  Index: DefaultTaskContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- DefaultTaskContext.java	23 May 2002 06:48:49 -0000	1.47
  +++ DefaultTaskContext.java	24 May 2002 04:19:02 -0000	1.48
  @@ -17,6 +17,7 @@
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.event.TaskEvent;
  +import org.apache.myrmidon.api.event.LogLevel;
   import org.apache.myrmidon.interfaces.event.TaskEventManager;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.property.PropertyResolver;
  @@ -28,7 +29,7 @@
    * Default implementation of TaskContext.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.47 $ $Date: 2002/05/23 06:48:49 $
  + * @version $Revision: 1.48 $ $Date: 2002/05/24 04:19:02 $
    */
   public class DefaultTaskContext
       implements TaskContext
  @@ -273,6 +274,7 @@
                                  m_location,
                                  message,
                                  throwable,
  +                               LogLevel.DEBUG,
                                  0 );
               getEventManager().fireTaskMessage( event );
           }
  @@ -314,6 +316,7 @@
                                  m_location,
                                  message,
                                  throwable,
  +                               LogLevel.VERBOSE,
                                  0 );
               getEventManager().fireTaskMessage( event );
           }
  @@ -355,6 +358,7 @@
                                  m_location,
                                  message,
                                  throwable,
  +                               LogLevel.INFO,
                                  0 );
               getEventManager().fireTaskMessage( event );
           }
  @@ -396,6 +400,7 @@
                                  m_location,
                                  message,
                                  throwable,
  +                               LogLevel.WARN,
                                  0 );
               getEventManager().fireTaskMessage( event );
           }
  @@ -437,6 +442,7 @@
                                  m_location,
                                  message,
                                  throwable,
  +                               LogLevel.ERROR,
                                  0 );
               getEventManager().fireTaskMessage( event );
           }
  
  
  

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