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/components/model DefaultProject.java
Date Tue, 29 May 2001 12:06:26 GMT
donaldp     01/05/29 05:06:26

  Modified:    proposal/myrmidon/src/java/org/apache/ant/convert
                        ConverterException.java
               proposal/myrmidon/src/java/org/apache/ant/convert/engine
                        DefaultConverterEngine.java
               proposal/myrmidon/src/java/org/apache/ant/modules/basic
                        AntCall.java Echo.java Pattern.java Property.java
               proposal/myrmidon/src/java/org/apache/ant/modules/core
                        AbstractResourceRegisterer.java
                        RegisterConverter.java RegisterDataType.java
                        RegisterTasklet.java RegisterTasklib.java
               proposal/myrmidon/src/java/org/apache/ant/modules/test
                        ConfigurationTest.java ContentTest.java
                        PrimitiveTypesTest.java SubElementTest.java
               proposal/myrmidon/src/java/org/apache/ant/util
                        Condition.java
               proposal/myrmidon/src/java/org/apache/myrmidon Main.java
               proposal/myrmidon/src/java/org/apache/myrmidon/api
                        AbstractTask.java DefaultTaskContext.java Task.java
                        TaskContext.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/builder
                        DefaultProjectBuilder.java ProjectBuilder.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor
                        MyrmidonEmbeddor.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/executor
                        DefaultExecutor.java Executor.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/manager
                        DefaultProjectManager.java ProjectManager.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/model
                        DefaultProject.java
  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/api
                        TaskException.java
  Removed:     proposal/myrmidon/src/java/org/apache/myrmidon
                        AntException.java
  Log:
  Removed need for AntException. Substituted TaskException where appropriate and used raw Exception in other places (ie setup of components).
  
  Revision  Changes    Path
  1.3       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/convert/ConverterException.java
  
  Index: ConverterException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/convert/ConverterException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConverterException.java	2001/05/29 10:46:59	1.2
  +++ ConverterException.java	2001/05/29 12:06:05	1.3
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.convert;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.avalon.framework.CascadingException;
   
   /**
    * ConverterException thrown when a problem occurs during convertion etc.
  @@ -15,7 +15,7 @@
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
   public class ConverterException
  -    extends AntException
  +    extends CascadingException
   {
       /**
        * Basic constructor with a message
  
  
  
  1.4       +0 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/convert/engine/DefaultConverterEngine.java
  
  Index: DefaultConverterEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/convert/engine/DefaultConverterEngine.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultConverterEngine.java	2001/05/29 10:47:01	1.3
  +++ DefaultConverterEngine.java	2001/05/29 12:06:06	1.4
  @@ -7,7 +7,6 @@
    */
   package org.apache.ant.convert.engine;
   
  -import org.apache.myrmidon.AntException;
   import org.apache.ant.convert.Converter;
   import org.apache.ant.convert.ConverterException;
   import org.apache.avalon.framework.logger.AbstractLoggable;
  
  
  
  1.9       +11 -11    jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/AntCall.java
  
  Index: AntCall.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/AntCall.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AntCall.java	2001/05/29 10:47:03	1.8
  +++ AntCall.java	2001/05/29 12:06:07	1.9
  @@ -8,23 +8,23 @@
   package org.apache.ant.modules.basic;
   
   import java.util.ArrayList;
  -import org.apache.myrmidon.AntException;
  -import org.apache.myrmidon.components.model.Project;
  -import org.apache.myrmidon.components.manager.ProjectManager;
  -import org.apache.myrmidon.api.AbstractTask;
  -import org.apache.myrmidon.api.DefaultTaskContext;
  -import org.apache.myrmidon.api.TaskContext;
  -import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.context.Context;
  +import org.apache.myrmidon.api.AbstractTask;
  +import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.DefaultTaskContext;
  +import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.components.manager.ProjectManager;
  +import org.apache.myrmidon.components.model.Project;
   
   /**
    * This is abstract base class for tasklets.
    *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  -public class AntCall 
  +public class AntCall
       extends AbstractTask
       implements Composable
   {
  @@ -39,7 +39,7 @@
       {
           super.contextualize( context );
           m_childContext = new DefaultTaskContext( getContext() );
  -    } 
  +    }
   
       public void compose( final ComponentManager componentManager )
           throws ComponentException
  @@ -67,11 +67,11 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           if( null == m_target )
           {
  -            throw new AntException( "Target attribute must be specified" );
  +            throw new TaskException( "Target attribute must be specified" );
           }
   
           final int size = m_properties.size();
  
  
  
  1.5       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Echo.java
  
  Index: Echo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Echo.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Echo.java	2001/05/29 10:47:04	1.4
  +++ Echo.java	2001/05/29 12:06:07	1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.modules.basic;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   
   /**
  @@ -26,7 +26,7 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           getLogger().warn( m_message );
       }
  
  
  
  1.3       +8 -8      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Pattern.java
  
  Index: Pattern.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Pattern.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Pattern.java	2001/05/29 10:47:04	1.2
  +++ Pattern.java	2001/05/29 12:06:07	1.3
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.modules.basic;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.ant.tasklet.DataType;
   import org.apache.ant.util.Condition;
   
  @@ -57,10 +57,10 @@
        * Set if clause on pattern.
        *
        * @param condition the condition
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       public void setIf( final String condition )
  -        throws AntException
  +        throws TaskException
       {
           verifyConditionNull();
           m_condition = new Condition( true, condition );
  @@ -70,10 +70,10 @@
        * Set unless clause of pattern.
        *
        * @param condition the unless clause
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       public void setUnless( final String condition )
  -        throws AntException
  +        throws TaskException
       {
           verifyConditionNull();
           m_condition = new Condition( false, condition );
  @@ -83,14 +83,14 @@
        * Utility method to make sure condition unset.
        * Made so that it is not possible for both if and unless to be set.
        *
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       protected void verifyConditionNull()
  -        throws AntException
  +        throws TaskException
       {
           if( null != m_condition )
           {
  -            throw new AntException( "Can only set one of if/else for pattern data type" );
  +            throw new TaskException( "Can only set one of if/else for pattern data type" );
           }
       }
   }
  
  
  
  1.8       +10 -10    jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Property.java	2001/05/29 10:47:05	1.7
  +++ Property.java	2001/05/29 12:06:08	1.8
  @@ -8,7 +8,7 @@
   package org.apache.ant.modules.basic;
   
   import java.util.Iterator;
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.ant.convert.Converter;
   import org.apache.ant.tasklet.DataType;
   import org.apache.ant.tasklet.engine.DataTypeEngine;
  @@ -65,9 +65,9 @@
               Object object = null;
   
               try { object = getContext().resolveValue( value ); }
  -            catch( final AntException ae )
  +            catch( final TaskException te )
               {
  -                throw new ConfigurationException( "Error resolving value: " + value, ae );
  +                throw new ConfigurationException( "Error resolving value: " + value, te );
               }
   
               if( null == object )
  @@ -91,9 +91,9 @@
               else if( name.equals( "value" ) )
               {
                   try { setValue( object ); }
  -                catch( final AntException ae )
  +                catch( final TaskException te )
                   {
  -                    throw new ConfigurationException( "Error setting value: " + value, ae );
  +                    throw new ConfigurationException( "Error setting value: " + value, te );
                   }
               }
               else if( name.equals( "local-scope" ) )
  @@ -140,11 +140,11 @@
       }
   
       public void setValue( final Object value )
  -        throws AntException
  +        throws TaskException
       {
           if( null != m_value )
           {
  -            throw new AntException( "Value can not be set multiple times" );
  +            throw new TaskException( "Value can not be set multiple times" );
           }
   
           m_value = value;
  @@ -156,16 +156,16 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           if( null == m_name )
           {
  -            throw new AntException( "Name must be specified" );
  +            throw new TaskException( "Name must be specified" );
           }
   
           if( null == m_value )
           {
  -            throw new AntException( "Value must be specified" );
  +            throw new TaskException( "Value must be specified" );
           }
   
           final TaskContext context = getContext();
  
  
  
  1.8       +8 -8      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/AbstractResourceRegisterer.java
  
  Index: AbstractResourceRegisterer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/AbstractResourceRegisterer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractResourceRegisterer.java	2001/05/29 10:47:09	1.7
  +++ AbstractResourceRegisterer.java	2001/05/29 12:06:09	1.8
  @@ -15,7 +15,7 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.components.deployer.TskDeployer;
   import org.apache.myrmidon.components.executor.Executor;
  @@ -65,15 +65,15 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           if( null == m_name )
           {
  -            throw new AntException( "Must specify name parameter" );
  +            throw new TaskException( "Must specify name parameter" );
           }
           else if( null == m_lib && null == m_classname )
           {
  -            throw new AntException( "Must specify classname if you don't specify " +
  +            throw new TaskException( "Must specify classname if you don't specify " +
                                       "lib parameter" );
           }
   
  @@ -85,12 +85,12 @@
           }
           catch( final RegistryException re )
           {
  -            throw new AntException( "Error registering resource", re );
  +            throw new TaskException( "Error registering resource", re );
           }
       }
   
       protected URL getURL( final String libName )
  -        throws AntException
  +        throws TaskException
       {
           if( null != libName )
           {
  @@ -98,7 +98,7 @@
               try { return lib.toURL(); }
               catch( final MalformedURLException mue )
               {
  -                throw new AntException( "Malformed task-lib parameter " + m_lib, mue );
  +                throw new TaskException( "Malformed task-lib parameter " + m_lib, mue );
               }
           }
           else
  @@ -108,5 +108,5 @@
       }
   
       protected abstract void registerResource( String name, String classname, URL url )
  -        throws AntException, RegistryException;
  +        throws TaskException, RegistryException;
   }
  
  
  
  1.8       +9 -9      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterConverter.java
  
  Index: RegisterConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterConverter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RegisterConverter.java	2001/05/29 10:47:10	1.7
  +++ RegisterConverter.java	2001/05/29 12:06:09	1.8
  @@ -10,7 +10,7 @@
   import java.io.File;
   import java.net.MalformedURLException;
   import java.net.URL;
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.ant.convert.engine.ConverterEngine;
   import org.apache.ant.convert.engine.DefaultConverterInfo;
   import org.apache.myrmidon.api.AbstractTask;
  @@ -69,11 +69,11 @@
       }
       
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           if( null == m_classname )
           {
  -            throw new AntException( "Must specify classname parameter" );
  +            throw new TaskException( "Must specify classname parameter" );
           }
           
           final URL url = getURL( m_lib );
  @@ -86,13 +86,13 @@
           }
           else if( null == m_sourceType || null == m_destinationType )
           {
  -            throw new AntException( "Must specify the source-type and destination-type " +
  +            throw new TaskException( "Must specify the source-type and destination-type " +
                                       "parameters when supplying a name" );
           }
   
           if( !isFullyDefined && null == url )
           {
  -            throw new AntException( "Must supply parameter if not fully specifying converter" );
  +            throw new TaskException( "Must supply parameter if not fully specifying converter" );
           }
   
           if( !isFullyDefined )
  @@ -103,7 +103,7 @@
               }
               catch( final DeploymentException de )
               {
  -                throw new AntException( "Failed deploying " + m_classname + 
  +                throw new TaskException( "Failed deploying " + m_classname + 
                                           " from " + url, de );
               }
           }
  @@ -120,13 +120,13 @@
               }
               catch( final RegistryException re )
               {
  -                throw new AntException( "Error registering resource", re );
  +                throw new TaskException( "Error registering resource", re );
               }
           }
       }
       
       protected URL getURL( final String libName )
  -        throws AntException
  +        throws TaskException
       {
           if( null != libName )
           {
  @@ -134,7 +134,7 @@
               try { return lib.toURL(); }
               catch( final MalformedURLException mue )
               {
  -                throw new AntException( "Malformed task-lib parameter " + m_lib, mue );
  +                throw new TaskException( "Malformed task-lib parameter " + m_lib, mue );
               }
           }
           else
  
  
  
  1.5       +6 -6      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterDataType.java
  
  Index: RegisterDataType.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterDataType.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegisterDataType.java	2001/05/29 10:47:11	1.4
  +++ RegisterDataType.java	2001/05/29 12:06:09	1.5
  @@ -8,10 +8,10 @@
   package org.apache.ant.modules.core;
   
   import java.net.URL;
  -import org.apache.myrmidon.AntException;
   import org.apache.avalon.framework.camelot.DefaultLocator;
   import org.apache.avalon.framework.camelot.DeploymentException;
   import org.apache.avalon.framework.camelot.RegistryException;
  +import org.apache.myrmidon.api.TaskException;
   
   /**
    * Method to register a single datatype.
  @@ -21,23 +21,23 @@
   public class RegisterDataType
       extends AbstractResourceRegisterer
   {
  -    protected void registerResource( final String name, 
  -                                     final String classname, 
  +    protected void registerResource( final String name,
  +                                     final String classname,
                                        final URL url )
  -        throws AntException, RegistryException 
  +        throws TaskException, RegistryException
       {
           if( null == classname )
           {
               try { m_tskDeployer.deployDataType( name, url.toString(), url ); }
               catch( final DeploymentException de )
               {
  -                throw new AntException( "Failed deploying " + name + " from " + url, de );
  +                throw new TaskException( "Failed deploying " + name + " from " + url, de );
               }
           }
           else
           {
               final DefaultLocator locator = new DefaultLocator( classname, url );
  -            m_dataTypeEngine.getRegistry().register( name, locator ); 
  +            m_dataTypeEngine.getRegistry().register( name, locator );
           }
       }
   }
  
  
  
  1.6       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklet.java
  
  Index: RegisterTasklet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RegisterTasklet.java	2001/05/29 10:47:11	1.5
  +++ RegisterTasklet.java	2001/05/29 12:06:10	1.6
  @@ -8,7 +8,7 @@
   package org.apache.ant.modules.core;
   
   import java.net.URL;
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.avalon.framework.camelot.DefaultLocator;
   import org.apache.avalon.framework.camelot.DeploymentException;
   import org.apache.avalon.framework.camelot.RegistryException;
  @@ -24,14 +24,14 @@
       protected void registerResource( final String name, 
                                        final String classname, 
                                        final URL url )
  -        throws AntException, RegistryException 
  +        throws TaskException, RegistryException 
       {
           if( null == classname )
           {
               try { m_tskDeployer.deployTask( name, url.toString(), url ); }
               catch( final DeploymentException de )
               {
  -                throw new AntException( "Failed deploying " + name + " from " + url, de );
  +                throw new TaskException( "Failed deploying " + name + " from " + url, de );
               }
           }
           else
  
  
  
  1.7       +5 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklib.java
  
  Index: RegisterTasklib.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklib.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RegisterTasklib.java	2001/05/29 10:47:12	1.6
  +++ RegisterTasklib.java	2001/05/29 12:06:10	1.7
  @@ -14,7 +14,7 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.components.deployer.TskDeployer;
   
  @@ -43,11 +43,11 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           if( null == m_lib )
           {
  -            throw new AntException( "Must specify lib parameter" );
  +            throw new TaskException( "Must specify lib parameter" );
           }
   
           URL url = null;
  @@ -56,7 +56,7 @@
           try { url = lib.toURL(); }
           catch( final MalformedURLException mue )
           {
  -            throw new AntException( "Malformed task-lib parameter " + m_lib, mue );
  +            throw new TaskException( "Malformed task-lib parameter " + m_lib, mue );
           }
   
           try
  @@ -65,7 +65,7 @@
           }
           catch( final DeploymentException de )
           {
  -            throw new AntException( "Error registering resource", de );
  +            throw new TaskException( "Error registering resource", de );
           }
       }
   }
  
  
  
  1.5       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/ConfigurationTest.java
  
  Index: ConfigurationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/ConfigurationTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConfigurationTest.java	2001/05/29 10:47:16	1.4
  +++ ConfigurationTest.java	2001/05/29 12:06:11	1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.modules.test;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -32,7 +32,7 @@
           Object object = null;
   
           try { object = getContext().resolveValue( message ); }
  -        catch( final AntException ae )
  +        catch( final TaskException ae )
           {
               throw new ConfigurationException( "Error resolving : " + message, ae );
           }
  @@ -48,7 +48,7 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
           getLogger().warn( m_message );
       }
  
  
  
  1.5       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/ContentTest.java
  
  Index: ContentTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/ContentTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ContentTest.java	2001/05/29 10:47:17	1.4
  +++ ContentTest.java	2001/05/29 12:06:12	1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.modules.test;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   
   /**
  @@ -31,7 +31,7 @@
       */
   
       public void execute()
  -        throws Exception
  +        throws TaskException
       {
       }
   }
  
  
  
  1.5       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/PrimitiveTypesTest.java
  
  Index: PrimitiveTypesTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/PrimitiveTypesTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PrimitiveTypesTest.java	2001/05/29 10:47:18	1.4
  +++ PrimitiveTypesTest.java	2001/05/29 12:06:12	1.5
  @@ -8,7 +8,7 @@
    */
   package org.apache.ant.modules.test;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   
   /**
  @@ -85,7 +85,7 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
       }
   }
  
  
  
  1.5       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/SubElementTest.java
  
  Index: SubElementTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/test/SubElementTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SubElementTest.java	2001/05/29 10:47:19	1.4
  +++ SubElementTest.java	2001/05/29 12:06:12	1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.modules.test;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
   
   /**
  @@ -38,7 +38,7 @@
       }
   
       public void execute()
  -        throws AntException
  +        throws TaskException
       {
       }
   }
  
  
  
  1.4       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/util/Condition.java
  
  Index: Condition.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/util/Condition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Condition.java	2001/05/29 10:47:23	1.3
  +++ Condition.java	2001/05/29 12:06:14	1.4
  @@ -7,7 +7,7 @@
    */
   package org.apache.ant.util;
   
  -import org.apache.myrmidon.AntException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  @@ -42,7 +42,7 @@
       }
       
       public boolean evaluate( final Context context )
  -        throws AntException
  +        throws TaskException
       {
           boolean result = false;
   
  @@ -66,7 +66,7 @@
           }
           catch( final PropertyException pe )
           {
  -            throw new AntException( "Error resolving " + m_condition, pe );
  +            throw new TaskException( "Error resolving " + m_condition, pe );
           }
   
           if( !m_isIfCondition )
  
  
  
  1.2       +13 -12    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/Main.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Main.java	2001/05/29 10:47:25	1.1
  +++ Main.java	2001/05/29 12:06:15	1.2
  @@ -34,6 +34,7 @@
   import org.apache.log.Priority;
   import org.apache.myrmidon.api.DefaultTaskContext;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.components.builder.ProjectBuilder;
   import org.apache.myrmidon.components.embeddor.Embeddor;
   import org.apache.myrmidon.components.embeddor.MyrmidonEmbeddor;
  @@ -107,7 +108,7 @@
           main.setLogger( Hierarchy.getDefaultHierarchy().getLoggerFor( "default" ) );
   
           try { main.execute( args ); }
  -        catch( final AntException ae )
  +        catch( final TaskException ae )
           {
               main.getLogger().error( "Error: " + ae.getMessage() );
               main.getLogger().debug( "Exception..." + ExceptionUtil.printStackTrace( ae ) );
  @@ -276,7 +277,7 @@
           m_homeDir = (new File( homeDir )).getAbsoluteFile();
           if( !m_homeDir.isDirectory() )
           {
  -            throw new AntException( "ant-home (" + m_homeDir + ") is not a directory" );
  +            throw new TaskException( "ant-home (" + m_homeDir + ") is not a directory" );
           }
   
           final File libDir = new File( m_homeDir, "lib" );
  @@ -284,7 +285,7 @@
           final File buildFile = (new File( filename )).getCanonicalFile();
           if( !buildFile.isFile() )
           {
  -            throw new AntException( "File " + buildFile + " is not a file or doesn't exist" );
  +            throw new TaskException( "File " + buildFile + " is not a file or doesn't exist" );
           }
   
           //setup classloader so that it will correctly load
  @@ -379,7 +380,7 @@
                   }
               }
           }
  -        catch( final AntException ae )
  +        catch( final TaskException ae )
           {
               getLogger().error( "BUILD FAILED" );
               getLogger().error( "Reason:\n" + ExceptionUtil.printStackTrace( ae, 5, true ) );
  @@ -391,17 +392,17 @@
        *
        * @param logLevel the log-level
        * @return the logger
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       protected Logger createLogger( final String logLevel )
  -        throws AntException
  +        throws TaskException
       {
           final String logLevelCapitalized = logLevel.toUpperCase();
           final Priority priority = Priority.getPriorityForName( logLevelCapitalized );
   
           if( !priority.getName().equals( logLevelCapitalized ) )
           {
  -            throw new AntException( "Unknown log level - " + logLevel );
  +            throw new TaskException( "Unknown log level - " + logLevel );
           }
   
           final Logger logger =
  @@ -418,14 +419,14 @@
        * @param listenerName the name of project listener
        */
       protected ProjectListener createListener( final String listenerName )
  -        throws AntException
  +        throws TaskException
       {
           ProjectListener result = null;
   
           try { result = (ProjectListener)Class.forName( listenerName ).newInstance(); }
           catch( final Throwable t )
           {
  -            throw new AntException( "Error creating the listener " + listenerName +
  +            throw new TaskException( "Error creating the listener " + listenerName +
                                       " due to " + ExceptionUtil.printStackTrace( t, 5, true ),
                                       t );
           }
  @@ -484,10 +485,10 @@
        *
        * @param project the project
        * @param defines the defines
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       protected void setupContext( final TaskContext context, final HashMap defines )
  -        throws AntException
  +        throws TaskException
       {
           //put these values into defines so that they overide
           //user-defined proeprties
  @@ -510,7 +511,7 @@
        * @param map the map of names->values
        */
       protected void addToContext( final TaskContext context, final Map map )
  -        throws AntException
  +        throws TaskException
       {
           final Iterator keys = map.keySet().iterator();
   
  
  
  
  1.3       +1 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java
  
  Index: AbstractTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractTask.java	2001/05/29 09:55:58	1.2
  +++ AbstractTask.java	2001/05/29 12:06:16	1.3
  @@ -54,7 +54,7 @@
        * @exception Exception if an error occurs
        */
       public abstract void execute()
  -        throws Exception;
  +        throws TaskException;
   
       /**
        * This will be called after execute() method.
  
  
  
  1.3       +19 -20    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/DefaultTaskContext.java
  
  Index: DefaultTaskContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/DefaultTaskContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultTaskContext.java	2001/05/29 10:47:27	1.2
  +++ DefaultTaskContext.java	2001/05/29 12:06:16	1.3
  @@ -8,7 +8,6 @@
   package org.apache.myrmidon.api;
   
   import java.io.File;
  -import org.apache.myrmidon.AntException;
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.avalon.excalibur.property.PropertyException;
   import org.apache.avalon.excalibur.property.PropertyUtil;
  @@ -116,12 +115,12 @@
        * @return the resolved property
        */
       public Object resolveValue( final String property )
  -        throws AntException
  +        throws TaskException
       {
           try { return PropertyUtil.resolveProperty( property, this, false ); }
           catch( final PropertyException pe )
           {
  -            throw new AntException( "Error resolving " + property + " due to " + pe.getMessage(),
  +            throw new TaskException( "Error resolving " + property + " due to " + pe.getMessage(),
                                       pe );
           }
       }
  @@ -148,7 +147,7 @@
        * @param value the value of property
        */
       public void setProperty( final String name, final Object value )
  -        throws AntException
  +        throws TaskException
       {
           setProperty( name, value, CURRENT );
       }
  @@ -159,7 +158,7 @@
        * @param property the property
        */
       public void setProperty(  final String name, final Object value, final ScopeEnum scope )
  -        throws AntException
  +        throws TaskException
       {
           checkPropertyValid( name, value );
   
  @@ -168,7 +167,7 @@
           {
               if( null == m_parent )
               {
  -                throw new AntException( "Can't set a property with parent scope when context " +
  +                throw new TaskException( "Can't set a property with parent scope when context " +
                                           " has no parent" );
               }
               else
  @@ -189,7 +188,7 @@
           }
           else
           {
  -            throw new AntException( "Can't set a property with an unknown " +
  +            throw new TaskException( "Can't set a property with an unknown " +
                                       "property context! (" + scope + ")" );
           }
       }
  @@ -203,14 +202,14 @@
        * @param value the value
        */
       public void putValue( final Object key, final Object value  )
  -        throws AntException
  +        throws TaskException
       {
           if( key.equals( BASE_DIRECTORY ) )
           {
               try { m_baseDirectory = (File)value; }
               catch( final ClassCastException cce )
               {
  -                throw new AntException( "Can not set baseDirectory to a non-file value.",
  +                throw new TaskException( "Can not set baseDirectory to a non-file value.",
                                           cce );
               }
           }
  @@ -223,28 +222,28 @@
        *
        * @param name the name of property
        * @param value the value of proeprty
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       protected void checkPropertyValid( final String name, final Object value )
  -        throws AntException
  +        throws TaskException
       {
           if( BASE_DIRECTORY.equals( name ) && !( value instanceof File ) )
           {
  -            throw new AntException( "Property " + BASE_DIRECTORY +
  -                                    " must have a value of type " +
  -                                    File.class.getName() );
  +            throw new TaskException( "Property " + BASE_DIRECTORY +
  +                                     " must have a value of type " +
  +                                     File.class.getName() );
           }
           else if( NAME.equals( name ) && !( value instanceof String ) )
           {
  -            throw new AntException( "Property " + NAME +
  -                                    " must have a value of type " +
  -                                    String.class.getName() );
  +            throw new TaskException( "Property " + NAME +
  +                                     " must have a value of type " +
  +                                     String.class.getName() );
           }
           else if( JAVA_VERSION.equals( name ) && !( value instanceof JavaVersion ) )
           {
  -            throw new AntException( "property " + JAVA_VERSION +
  -                                    " must have a value of type " +
  -                                    JavaVersion.class.getName() );
  +            throw new TaskException( "property " + JAVA_VERSION +
  +                                     " must have a value of type " +
  +                                     JavaVersion.class.getName() );
           }
       }
   }
  
  
  
  1.2       +3 -4      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java
  
  Index: Task.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Task.java	2001/05/28 07:36:54	1.1
  +++ Task.java	2001/05/29 12:06:16	1.2
  @@ -20,7 +20,6 @@
    * to task object.
    *
    * The Components passed in via ComponentManager are determined by container.
  - * Most containers will include the Engine and Registrys.
    *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  @@ -30,10 +29,10 @@
        * Execute task. 
        * This method is called to perform actual work associated with task.
        * It is called after Task has been Configured and Initialized and before
  -     * beig Disposed (If task implements appropriate interfaces).
  +     * being Disposed (If task implements appropriate interfaces).
        *
  -     * @exception Exception if an error occurs
  +     * @exception TaskException if an error occurs
        */
       void execute()
  -        throws Exception;
  +        throws TaskException;
   }
  
  
  
  1.3       +4 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java
  
  Index: TaskContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TaskContext.java	2001/05/29 10:47:28	1.2
  +++ TaskContext.java	2001/05/29 12:06:16	1.3
  @@ -10,7 +10,6 @@
   import java.io.File;
   import org.apache.avalon.framework.Enum;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.myrmidon.AntException;
   
   /**
    * This interface represents the <em>Context</em> in which Task is executed.
  @@ -67,7 +66,7 @@
        * @return the resolved file
        */
       File resolveFile( String filename )
  -        throws AntException;
  +        throws TaskException;
   
       /**
        * Resolve property.
  @@ -77,7 +76,7 @@
        * @return the resolved property
        */
       Object resolveValue( String property )
  -        throws AntException;
  +        throws TaskException;
   
       /**
        * Retrieve property for name.
  @@ -94,7 +93,7 @@
        * @param value the value of property
        */
       void setProperty( String name, Object value )
  -        throws AntException;
  +        throws TaskException;
   
       /**
        * Set property value.
  @@ -104,7 +103,7 @@
        * @param scope the scope at which to set property
        */
       void setProperty( String name, Object value, ScopeEnum scope )
  -        throws AntException;
  +        throws TaskException;
   
       /**
        * Safe wrapper class for Scope enums.
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java
  
  Index: TaskException.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 file.
   */
  package org.apache.myrmidon.api;
  
  import org.apache.avalon.framework.CascadingException;
  
  /**
   * TaskException thrown when a problem with tasks etc.
   * It is cascading so that further embedded information can be contained.
   * ie TaskException was caused by IOException etc.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public class TaskException
      extends CascadingException
  {
      /**
       * Basic constructor with a message
       *
       * @param message the message
       */
      public TaskException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Constructor that builds cascade so that other exception information can be retained.
       *
       * @param message the message
       * @param throwable the throwable
       */
      public TaskException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  
  1.4       +16 -47    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
  
  Index: DefaultProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultProjectBuilder.java	2001/05/29 10:47:31	1.3
  +++ DefaultProjectBuilder.java	2001/05/29 12:06:18	1.4
  @@ -16,7 +16,6 @@
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.log.Logger;
  -import org.apache.myrmidon.AntException;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.components.model.DefaultProject;
   import org.apache.myrmidon.components.model.DefaultTarget;
  @@ -47,44 +46,14 @@
        * @param source the source
        * @return the constructed Project
        * @exception IOException if an error occurs
  -     * @exception AntException if an error occurs
  +     * @exception Exception if an error occurs
        */
       public Project build( final File projectFile )
  -        throws IOException, AntException
  +        throws Exception
       {
  -        try
  -        {
  -            final String location = projectFile.getCanonicalFile().toString();
  -            final Configuration configuration = buildConfiguration( location );
  -            return build( projectFile, configuration );
  -        }
  -        catch( final ConfigurationException ce )
  -        {
  -            throw new AntException( "ConfigurationException: " + ce.getMessage(), ce );
  -        }
  -    }
  -
  -    /**
  -     * Utility method to build a Configuration tree from a source.
  -     * Overide this in sub-classes if you want to provide extra
  -     * functionality (ie xslt/css).
  -     *
  -     * @param location the location
  -     * @return the created Configuration
  -     * @exception AntException if an error occurs
  -     * @exception IOException if an error occurs
  -     */
  -    protected Configuration buildConfiguration( final String location )
  -        throws AntException, IOException, ConfigurationException
  -    {
  -        try
  -        {
  -            return (Configuration)m_builder.buildFromFile( location );
  -        }
  -        catch( final SAXException se )
  -        {
  -            throw new AntException( "SAXEception: " + se.getMessage(), se );
  -        }
  +        final String location = projectFile.getCanonicalFile().toString();
  +        final Configuration configuration = (Configuration)m_builder.buildFromFile( location );
  +        return build( projectFile, configuration );
       }
   
       /**
  @@ -94,15 +63,15 @@
        * @param configuration the configuration loaded
        * @return the created Project
        * @exception IOException if an error occurs
  -     * @exception AntException if an error occurs
  +     * @exception Exception if an error occurs
        * @exception ConfigurationException if an error occurs
        */
       protected Project build( final File file, final Configuration configuration )
  -        throws IOException, AntException, ConfigurationException
  +        throws Exception
       {
           if( !configuration.getName().equals("project") )
           {
  -            throw new AntException( "Project file must be enclosed in project element" );
  +            throw new Exception( "Project file must be enclosed in project element" );
           }
   
           //get project-level attributes
  @@ -133,11 +102,11 @@
        *
        * @param project the project
        * @param configuration the Configuration
  -     * @exception AntException if an error occurs
  +     * @exception Exception if an error occurs
        */
       protected void buildTopLevelProject( final DefaultProject project,
                                            final Configuration configuration )
  -        throws AntException
  +        throws Exception
       {
           final Configuration[] children = configuration.getChildren();
   
  @@ -151,7 +120,7 @@
               else if( name.equals( "property" ) ) buildImplicitTask( project, element );
               else
               {
  -                throw new AntException( "Unknown top-level element " + name +
  +                throw new Exception( "Unknown top-level element " + name +
                                           " at " + element.getLocation() );
               }
           }
  @@ -164,7 +133,7 @@
        * @param task the Configuration
        */
       protected void buildTarget( final DefaultProject project, final Configuration target )
  -        throws AntException
  +        throws Exception
       {
           final String name = target.getAttribute( "name", null );
           final String depends = target.getAttribute( "depends", null );
  @@ -173,7 +142,7 @@
   
           if( null == name )
           {
  -            throw new AntException( "Discovered un-named target at " +
  +            throw new Exception( "Discovered un-named target at " +
                                       target.getLocation() );
           }
   
  @@ -181,7 +150,7 @@
   
           if( null != ifCondition && null != unlessCondition )
           {
  -            throw new AntException( "Discovered invalid target that has both a if and " +
  +            throw new Exception( "Discovered invalid target that has both a if and " +
                                       "unless condition at " + target.getLocation() );
           }
   
  @@ -211,8 +180,8 @@
   
                   if( 0 == dependency.length() )
                   {
  -                    throw new AntException( "Discovered empty dependency in target " +
  -                                            target.getName() + " at " + target.getLocation() );
  +                    throw new Exception( "Discovered empty dependency in target " +
  +                                         target.getName() + " at " + target.getLocation() );
                   }
   
                   getLogger().debug( "Target dependency: " + dependency );
  
  
  
  1.4       +1 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/ProjectBuilder.java
  
  Index: ProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/ProjectBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProjectBuilder.java	2001/05/29 10:47:32	1.3
  +++ ProjectBuilder.java	2001/05/29 12:06:18	1.4
  @@ -9,7 +9,6 @@
   
   import java.io.File;
   import java.io.IOException;
  -import org.apache.myrmidon.AntException;
   import org.apache.avalon.framework.component.Component;
   import org.apache.myrmidon.components.model.Project;
   
  @@ -30,5 +29,5 @@
        * @exception AntException if an error occurs
        */
       Project build( File source )
  -        throws IOException, AntException;
  +        throws Exception;
   }
  
  
  
  1.8       +14 -17    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor/MyrmidonEmbeddor.java
  
  Index: MyrmidonEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor/MyrmidonEmbeddor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MyrmidonEmbeddor.java	2001/05/29 10:47:37	1.7
  +++ MyrmidonEmbeddor.java	2001/05/29 12:06:20	1.8
  @@ -8,7 +8,6 @@
   package org.apache.myrmidon.components.embeddor;
   
   import java.io.File;
  -import org.apache.myrmidon.AntException;
   import org.apache.ant.convert.engine.ConverterEngine;
   import org.apache.ant.tasklet.engine.DataTypeEngine;
   import org.apache.avalon.excalibur.io.FileUtil;
  @@ -290,7 +289,7 @@
        * Setup all the files attributes.
        */
       private void setupFiles()
  -        throws AntException
  +        throws Exception
       {
           String filepath = null;
   
  @@ -333,10 +332,10 @@
        * @param dir the base directory
        * @param name the relative directory
        * @return the created File
  -     * @exception AntException if an error occurs
  +     * @exception Exception if an error occurs
        */
       private File resolveDirectory( final String dir, final String name )
  -        throws AntException
  +        throws Exception
       {
           final File file = FileUtil.resolveFile( m_homeDir, dir );
           checkDirectory( file, name );
  @@ -350,15 +349,15 @@
        * @param name the name of file type (used in error messages)
        */
       private void checkDirectory( final File file, final String name )
  -        throws AntException
  +        throws Exception
       {
           if( !file.exists() )
           {
  -            throw new AntException( name + " (" + file + ") does not exist" );
  +            throw new Exception( name + " (" + file + ") does not exist" );
           }
           else if( !file.isDirectory() )
           {
  -            throw new AntException( name + " (" + file + ") is not a directory" );
  +            throw new Exception( name + " (" + file + ") is not a directory" );
           }
       }
   
  @@ -392,10 +391,10 @@
        * @param component the name of the component
        * @param clazz the name of interface/type
        * @return the created object
  -     * @exception AntException if an error occurs
  +     * @exception Exception if an error occurs
        */
       private Object createComponent( final String component, final Class clazz )
  -        throws AntException
  +        throws Exception
       {
           try
           {
  @@ -403,26 +402,24 @@
   
               if( !clazz.isInstance( object ) )
               {
  -                throw new AntException( "Object " + component + " is not an instance of " +
  -                                        clazz );
  +                throw new Exception( "Object " + component + " is not an instance of " +
  +                                     clazz );
               }
   
               return object;
           }
           catch( final IllegalAccessException iae )
           {
  -            throw new AntException( "Non-public constructor for " + clazz + " " + component,
  -                                    iae );
  +            throw new Exception( "Non-public constructor for " + clazz + " " + component );
           }
           catch( final InstantiationException ie )
           {
  -            throw new AntException( "Error instantiating class for " + clazz + " " + component,
  -                                    ie );
  +            throw new Exception( "Error instantiating class for " + clazz + " " + component );
           }
           catch( final ClassNotFoundException cnfe )
           {
  -            throw new AntException( "Could not find the class for " + clazz +
  -                                    " (" + component + ")", cnfe );
  +            throw new Exception( "Could not find the class for " + clazz + 
  +                                 " (" + component + ")" );
           }
       }
   }
  
  
  
  1.3       +41 -45    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java
  
  Index: DefaultExecutor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultExecutor.java	2001/05/29 10:47:41	1.2
  +++ DefaultExecutor.java	2001/05/29 12:06:21	1.3
  @@ -7,8 +7,6 @@
    */
   package org.apache.myrmidon.components.executor;
   
  -import java.util.HashMap;
  -import org.apache.myrmidon.AntException;
   import org.apache.ant.convert.engine.ConverterEngine;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  @@ -33,17 +31,19 @@
   import org.apache.log.Logger;
   import org.apache.myrmidon.api.Task;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.components.configurer.Configurer;
   
   public class DefaultExecutor
       extends AbstractLoggable
       implements Executor, Composable
   {
  -    protected Factory              m_factory;
  -    protected Registry             m_registry   = new DefaultRegistry( Locator.class );
  -    protected Configurer           m_configurer;
  +    private Factory              m_factory;
  +    private Registry             m_registry   = new DefaultRegistry( Locator.class );
  +    private Configurer           m_configurer;
   
  -    protected ComponentManager     m_componentManager;
  +    private ComponentManager     m_componentManager;
   
       public Registry getRegistry()
       {
  @@ -69,7 +69,7 @@
       }
   
       public void execute( final Configuration taskData, final TaskContext context )
  -        throws AntException
  +        throws TaskException
       {
           getLogger().debug( "Creating" );
           final Task task = createTask( taskData.getName() );
  @@ -89,18 +89,14 @@
   
           getLogger().debug( "Running" );
   
  -        try { task.execute(); }
  -        catch( final Exception e )
  -        {
  -            throw new AntException( "Error executing task", e );
  -        }
  +        task.execute();
   
           getLogger().debug( "Disposing" );
           doDispose( task, taskData );
       }
   
  -    protected Task createTask( final String name )
  -        throws AntException
  +    private Task createTask( final String name )
  +        throws TaskException
       {
           try
           {
  @@ -109,47 +105,47 @@
           }
           catch( final RegistryException re )
           {
  -            throw new AntException( "Unable to locate task " + name, re );
  +            throw new TaskException( "Unable to locate task " + name, re );
           }
           catch( final FactoryException fe )
           {
  -            throw new AntException( "Unable to create task " + name, fe );
  +            throw new TaskException( "Unable to create task " + name, fe );
           }
       }
   
  -    protected void doConfigure( final Task task,
  -                                final Configuration taskData,
  -                                final TaskContext context )
  -        throws AntException
  +    private void doConfigure( final Task task,
  +                              final Configuration taskData,
  +                              final TaskContext context )
  +        throws TaskException
       {
           try { m_configurer.configure( task, taskData, context ); }
           catch( final Throwable throwable )
           {
  -            throw new AntException( "Error configuring task " +  taskData.getName() + " at " +
  -                                    taskData.getLocation() + "(Reason: " +
  -                                    throwable.getMessage() + ")", throwable );
  +            throw new TaskException( "Error configuring task " +  taskData.getName() + " at " +
  +                                     taskData.getLocation() + "(Reason: " +
  +                                     throwable.getMessage() + ")", throwable );
           }
       }
   
  -    protected void doCompose( final Task task, final Configuration taskData )
  -        throws AntException
  +    private void doCompose( final Task task, final Configuration taskData )
  +        throws TaskException
       {
           if( task instanceof Composable )
           {
               try { ((Composable)task).compose( m_componentManager ); }
               catch( final Throwable throwable )
               {
  -                throw new AntException( "Error composing task " +  taskData.getName() + " at " +
  -                                        taskData.getLocation() + "(Reason: " +
  -                                        throwable.getMessage() + ")", throwable );
  +                throw new TaskException( "Error composing task " +  taskData.getName() + " at " +
  +                                         taskData.getLocation() + "(Reason: " +
  +                                         throwable.getMessage() + ")", throwable );
               }
           }
       }
   
  -    protected void doContextualize( final Task task,
  -                                    final Configuration taskData,
  -                                    final TaskContext context )
  -        throws AntException
  +    private void doContextualize( final Task task,
  +                                  final Configuration taskData,
  +                                  final TaskContext context )
  +        throws TaskException
       {
           try
           {
  @@ -160,38 +156,38 @@
           }
           catch( final Throwable throwable )
           {
  -            throw new AntException( "Error contextualizing task " +  taskData.getName() + " at " +
  -                                    taskData.getLocation() + "(Reason: " +
  -                                    throwable.getMessage() + ")", throwable );
  +            throw new TaskException( "Error contextualizing task " +  taskData.getName() + " at " +
  +                                     taskData.getLocation() + "(Reason: " +
  +                                     throwable.getMessage() + ")", throwable );
           }
       }
   
  -    protected void doDispose( final Task task, final Configuration taskData )
  -        throws AntException
  +    private void doDispose( final Task task, final Configuration taskData )
  +        throws TaskException
       {
           if( task instanceof Disposable )
           {
               try { ((Disposable)task).dispose(); }
               catch( final Throwable throwable )
               {
  -                throw new AntException( "Error disposing task " +  taskData.getName() + " at " +
  -                                        taskData.getLocation() + "(Reason: " +
  -                                        throwable.getMessage() + ")", throwable );
  +                throw new TaskException( "Error disposing task " +  taskData.getName() + " at " +
  +                                         taskData.getLocation() + "(Reason: " +
  +                                         throwable.getMessage() + ")", throwable );
               }
           }
       }
   
  -    protected void doInitialize( final Task task, final Configuration taskData )
  -        throws AntException
  +    private void doInitialize( final Task task, final Configuration taskData )
  +        throws TaskException
       {
           if( task instanceof Initializable )
           {
               try { ((Initializable)task).initialize(); }
               catch( final Throwable throwable )
               {
  -                throw new AntException( "Error initializing task " +  taskData.getName() + " at " +
  -                                        taskData.getLocation() + "(Reason: " +
  -                                        throwable.getMessage() + ")", throwable );
  +                throw new TaskException( "Error initializing task " +  taskData.getName() + " at " +
  +                                         taskData.getLocation() + "(Reason: " +
  +                                         throwable.getMessage() + ")", throwable );
               }
           }
       }
  
  
  
  1.3       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Executor.java
  
  Index: Executor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Executor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Executor.java	2001/05/29 10:47:43	1.2
  +++ Executor.java	2001/05/29 12:06:22	1.3
  @@ -7,11 +7,11 @@
    */
   package org.apache.myrmidon.components.executor;
   
  -import org.apache.myrmidon.AntException;
   import org.apache.avalon.framework.camelot.Registry;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
    
   /**
    * Engine inteface that should be implemented by all tasklet engines.
  @@ -33,8 +33,8 @@
        * execute a task.
        *
        * @param task the configruation data for task
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       void execute( Configuration task, TaskContext context )
  -        throws AntException;
  +        throws TaskException;
   }
  
  
  
  1.3       +13 -14    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/manager/DefaultProjectManager.java
  
  Index: DefaultProjectManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/manager/DefaultProjectManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultProjectManager.java	2001/05/29 10:47:47	1.2
  +++ DefaultProjectManager.java	2001/05/29 12:06:23	1.3
  @@ -8,8 +8,6 @@
   package org.apache.myrmidon.components.manager;
   
   import java.util.ArrayList;
  -import java.util.Iterator;
  -import org.apache.myrmidon.AntException;
   import org.apache.ant.util.Condition;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  @@ -23,6 +21,7 @@
   import org.apache.log.Logger;
   import org.apache.myrmidon.api.DefaultTaskContext;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.components.executor.Executor;
   import org.apache.myrmidon.components.model.Project;
   import org.apache.myrmidon.components.model.Target;
  @@ -81,10 +80,10 @@
        *
        * @param project the Project
        * @param target the name of the target
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       public void executeTarget( final Project project, final String target, final TaskContext context )
  -        throws AntException
  +        throws TaskException
       {
           //HACK: should do this a better way !!!!!!
           m_componentManager.put( "org.apache.ant.project.Project", project );
  @@ -104,10 +103,10 @@
        * @param project the Project
        * @param target the name of the target
        * @param context the context
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       public void execute( Project project, String target, TaskContext context )
  -        throws AntException
  +        throws TaskException
       {
           execute( project, target, context, new ArrayList() );
       }
  @@ -119,19 +118,19 @@
        * @param target the name of the target
        * @param context the context
        * @param done the list of targets already executed in current run
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       private void execute( final Project project,
                             final String targetName,
                             final TaskContext context,
                             final ArrayList done )
  -        throws AntException
  +        throws TaskException
       {
           final Target target = project.getTarget( targetName );
   
           if( null == target )
           {
  -            throw new AntException( "Unable to find target " + targetName );
  +            throw new TaskException( "Unable to find target " + targetName );
           }
   
           //add target to list of targets executed
  @@ -156,12 +155,12 @@
        * @param targetName the name of target
        * @param target the target
        * @param context the context in which to execute
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       private void executeTarget( final String targetName,
                                   final Target target,
                                   final TaskContext context )
  -        throws AntException
  +        throws TaskException
       {
           //is this necessary ? I think not but ....
           // NO it isn't because you set target name and project has already been provided
  @@ -192,7 +191,7 @@
       private void executeTargetWork( final String name,
                                       final Target target,
                                       final TaskContext context )
  -        throws AntException
  +        throws TaskException
       {
           //check the condition associated with target.
           //if it is not satisfied then skip target
  @@ -222,10 +221,10 @@
        *
        * @param task the task definition
        * @param context the context
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       private void executeTask( final Configuration task, final TaskContext context )
  -        throws AntException
  +        throws TaskException
       {
           final String name = task.getName();
           getLogger().debug( "Executing task " + name );
  
  
  
  1.3       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/manager/ProjectManager.java
  
  Index: ProjectManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/manager/ProjectManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProjectManager.java	2001/05/29 10:47:48	1.2
  +++ ProjectManager.java	2001/05/29 12:06:23	1.3
  @@ -7,9 +7,9 @@
    */
   package org.apache.myrmidon.components.manager;
   
  -import org.apache.myrmidon.AntException;
   import org.apache.avalon.framework.component.Component;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.components.model.Project;
   import org.apache.myrmidon.listeners.ProjectListener;
   
  @@ -42,8 +42,8 @@
        * @param project the Project
        * @param target the name of the target
        * @param context the context
  -     * @exception AntException if an error occurs
  +     * @exception TaskException if an error occurs
        */
       void executeTarget( Project project, String target, TaskContext context )
  -        throws AntException;
  +        throws TaskException;
   }
  
  
  
  1.3       +3 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/model/DefaultProject.java
  
  Index: DefaultProject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/model/DefaultProject.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultProject.java	2001/05/29 10:47:52	1.2
  +++ DefaultProject.java	2001/05/29 12:06:25	1.3
  @@ -10,7 +10,6 @@
   import java.io.File;
   import java.io.IOException;
   import java.util.HashMap;
  -import org.apache.myrmidon.AntException;
   
   /**
    * Default project implementation.
  @@ -119,15 +118,14 @@
        *
        * @param name the name of target
        * @param target the Target
  -     * @exception AntException if an error occurs
  +     * @exception IllegalArgumentException if target already exists with same name
        */
       public final void addTarget( final String name, final Target target )
  -        throws AntException
       {
           if( null != m_targets.get( name ) )
           {
  -            throw new AntException( "Can not have two targets in a file with the name " +
  -                                    name );
  +            throw new IllegalArgumentException( "Can not have two targets in a " + 
  +                                                "file with the name " + name );
           }
           else
           {
  
  
  

Mime
View raw message