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/framework TypeInstanceTask.java
Date Fri, 01 Mar 2002 10:33:38 GMT
donaldp     02/03/01 02:33:38

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service
                        AntServiceException.java
               proposal/myrmidon/src/java/org/apache/aut/converter
                        ConverterException.java
               proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer
                        DeploymentException.java
               proposal/myrmidon/src/java/org/apache/aut/nativelib
                        ExecException.java
               proposal/myrmidon/src/java/org/apache/aut/vfs
                        FileSystemException.java
               proposal/myrmidon/src/java/org/apache/aut/manifest
                        ManifestException.java
               proposal/myrmidon/src/java/org/apache/antlib/core
                        Property.java
               proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role
                        RoleException.java
               proposal/myrmidon/src/java/org/apache/myrmidon/api
                        TaskException.java
               proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type
                        TypeException.java
               proposal/myrmidon/src/java/org/apache/myrmidon/framework
                        TypeInstanceTask.java
  Log:
  Decouple exceptions from CascadingException
  
  Revision  Changes    Path
  1.2       +19 -5     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/AntServiceException.java
  
  Index: AntServiceException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/AntServiceException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AntServiceException.java	21 Feb 2002 11:06:40 -0000	1.1
  +++ AntServiceException.java	1 Mar 2002 10:33:37 -0000	1.2
  @@ -7,19 +7,22 @@
    */
   package org.apache.myrmidon.interfaces.service;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * ServiceException thrown when a service can not be created for
    * some reason.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/21 11:06:40 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/01 10:33:37 $
    */
   public class AntServiceException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Basic constructor for exception that does not specify a message
        */
       public AntServiceException()
  @@ -45,7 +48,18 @@
        */
       public AntServiceException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
   
  
  
  
  1.4       +19 -5     jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterException.java
  
  Index: ConverterException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterException.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConverterException.java	21 Feb 2002 10:16:42 -0000	1.3
  +++ ConverterException.java	1 Mar 2002 10:33:37 -0000	1.4
  @@ -7,18 +7,21 @@
    */
   package org.apache.aut.converter;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * ConverterException thrown when a problem occurs during convertion etc.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/02/21 10:16:42 $
  + * @version $Revision: 1.4 $ $Date: 2002/03/01 10:33:37 $
    */
   public class ConverterException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Basic constructor with a message
        *
        * @param message the message
  @@ -36,7 +39,18 @@
        */
       public ConverterException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
   
  
  
  
  1.5       +19 -5     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/DeploymentException.java
  
  Index: DeploymentException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/DeploymentException.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeploymentException.java	7 Feb 2002 13:01:20 -0000	1.4
  +++ DeploymentException.java	1 Mar 2002 10:33:37 -0000	1.5
  @@ -7,18 +7,21 @@
    */
   package org.apache.myrmidon.interfaces.deployer;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * Exception to indicate error deploying.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/02/07 13:01:20 $
  + * @version $Revision: 1.5 $ $Date: 2002/03/01 10:33:37 $
    */
   public final class DeploymentException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Construct a new <code>DeploymentException</code> instance.
        *
        * @param message The detail message for this exception.
  @@ -36,6 +39,17 @@
        */
       public DeploymentException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
  
  
  
  1.2       +18 -4     jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/ExecException.java
  
  Index: ExecException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/ExecException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExecException.java	12 Jan 2002 04:51:07 -0000	1.1
  +++ ExecException.java	1 Mar 2002 10:33:37 -0000	1.2
  @@ -7,17 +7,20 @@
    */
   package org.apache.aut.nativelib;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * ExecException indicates there was an error executing native process.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    */
   public class ExecException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Basic constructor for exception that does not specify a message
        */
       public ExecException()
  @@ -43,7 +46,18 @@
        */
       public ExecException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
   
  
  
  
  1.3       +26 -10    jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/vfs/FileSystemException.java
  
  Index: FileSystemException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/vfs/FileSystemException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileSystemException.java	6 Feb 2002 07:28:40 -0000	1.2
  +++ FileSystemException.java	1 Mar 2002 10:33:37 -0000	1.3
  @@ -7,33 +7,49 @@
    */
   package org.apache.aut.vfs;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * Thrown for file system errors.
    *
    * @author Adam Murdoch
    */
  -public class FileSystemException extends CascadingException
  +public class FileSystemException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Constructs exception with the specified detail message.
        *
  -     * @param   msg   the detail message.
  +     * @param   message   the detail message.
        */
  -    public FileSystemException( String msg )
  +    public FileSystemException( final String message )
       {
  -        super( msg );
  +        this( message, null );
       }
   
       /**
        * Constructs exception with the specified detail message.
        *
  -     * @param   msg   the detail message.
  -     * @param   cause the cause.
  +     * @param   message   the detail message.
  +     * @param   throwable the cause.
  +     */
  +    public FileSystemException( final String message,
  +                                final Throwable throwable )
  +    {
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
        */
  -    public FileSystemException( String msg, Throwable cause )
  +    public final Throwable getCause()
       {
  -        super( msg, cause );
  +        return m_throwable;
       }
   }
  
  
  
  1.2       +19 -5     jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/manifest/ManifestException.java
  
  Index: ManifestException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/manifest/ManifestException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ManifestException.java	9 Feb 2002 05:51:20 -0000	1.1
  +++ ManifestException.java	1 Mar 2002 10:33:38 -0000	1.2
  @@ -7,19 +7,22 @@
    */
   package org.apache.aut.manifest;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * ManifestException is thrown when there is a problem parsing, generating or
    * handling a Manifest.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/09 05:51:20 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/01 10:33:38 $
    */
   public class ManifestException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Basic constructor for exception that does not specify a message
        */
       public ManifestException()
  @@ -45,6 +48,17 @@
        */
       public ManifestException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
  
  
  
  1.12      +2 -16     jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Property.java	26 Feb 2002 23:26:56 -0000	1.11
  +++ Property.java	1 Mar 2002 10:33:38 -0000	1.12
  @@ -10,7 +10,6 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.myrmidon.api.AbstractTask;
  -import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.DataType;
   
  @@ -20,7 +19,7 @@
    * TODO: Determine final format of property task.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.11 $ $Date: 2002/02/26 23:26:56 $
  + * @version $Revision: 1.12 $ $Date: 2002/03/01 10:33:38 $
    * @ant:task name="property"
    */
   public class Property
  @@ -31,18 +30,12 @@
   
       private String m_name;
       private Object m_value;
  -    private boolean m_localScope = true;
   
       public void setName( final String name )
       {
           m_name = name;
       }
   
  -    public void setLocalScope( final boolean localScope )
  -    {
  -        m_localScope = localScope;
  -    }
  -
       /**
        * Sets the property value from a nested element.
        */
  @@ -91,13 +84,6 @@
               throw new TaskException( message );
           }
   
  -        if( m_localScope )
  -        {
  -            getContext().setProperty( m_name, m_value );
  -        }
  -        else
  -        {
  -            getContext().setProperty( m_name, m_value, TaskContext.PARENT );
  -        }
  +        getContext().setProperty( m_name, m_value );
       }
   }
  
  
  
  1.2       +23 -8     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role/RoleException.java
  
  Index: RoleException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role/RoleException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RoleException.java	21 Feb 2002 12:52:07 -0000	1.1
  +++ RoleException.java	1 Mar 2002 10:33:38 -0000	1.2
  @@ -7,24 +7,39 @@
    */
   package org.apache.myrmidon.interfaces.role;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * An exception thrown by the RoleManager.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/21 12:52:07 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/01 10:33:38 $
    */
   public class RoleException
  -    extends CascadingException
  +    extends Exception
   {
  -    public RoleException( String s )
  +    /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    public RoleException( final String message )
  +    {
  +        this( message, null );
  +    }
  +
  +    public RoleException( final String message,
  +                          final Throwable throwable )
       {
  -        super( s );
  +        super( message );
  +        m_throwable = throwable;
       }
   
  -    public RoleException( String s, Throwable throwable )
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
       {
  -        super( s, throwable );
  +        return m_throwable;
       }
   }
  
  
  
  1.6       +19 -5     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java
  
  Index: TaskException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TaskException.java	7 Feb 2002 13:00:44 -0000	1.5
  +++ TaskException.java	1 Mar 2002 10:33:38 -0000	1.6
  @@ -7,20 +7,23 @@
    */
   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:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.5 $ $Date: 2002/02/07 13:00:44 $
  + * @version $Revision: 1.6 $ $Date: 2002/03/01 10:33:38 $
    */
   public class TaskException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Basic constructor for exception that does not specify a message
        */
       public TaskException()
  @@ -46,7 +49,18 @@
        */
       public TaskException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
   
  
  
  
  1.5       +19 -5     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/TypeException.java
  
  Index: TypeException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/TypeException.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TypeException.java	7 Feb 2002 13:01:20 -0000	1.4
  +++ TypeException.java	1 Mar 2002 10:33:38 -0000	1.5
  @@ -7,18 +7,21 @@
    */
   package org.apache.myrmidon.interfaces.type;
   
  -import org.apache.avalon.framework.CascadingException;
  -
   /**
    * Exception to indicate problem with type instantiating.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/02/07 13:01:20 $
  + * @version $Revision: 1.5 $ $Date: 2002/03/01 10:33:38 $
    */
   public final class TypeException
  -    extends CascadingException
  +    extends Exception
   {
       /**
  +     * The Throwable that caused this exception to be thrown.
  +     */
  +    private final Throwable m_throwable;
  +
  +    /**
        * Construct a new <code>TypeException</code> instance.
        *
        * @param message The detail message for this exception.
  @@ -36,6 +39,17 @@
        */
       public TypeException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        m_throwable = throwable;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
   }
  
  
  
  1.13      +2 -16     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java
  
  Index: TypeInstanceTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TypeInstanceTask.java	14 Feb 2002 10:21:12 -0000	1.12
  +++ TypeInstanceTask.java	1 Mar 2002 10:33:38 -0000	1.13
  @@ -13,14 +13,13 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  -import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   
   /**
    * This is the property "task" to declare a binding of a datatype to a name.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.12 $ $Date: 2002/02/14 10:21:12 $
  + * @version $Revision: 1.13 $ $Date: 2002/03/01 10:33:38 $
    */
   public class TypeInstanceTask
       extends AbstractContainerTask
  @@ -31,7 +30,6 @@
   
       private String m_id;
       private Object m_value;
  -    private boolean m_localScope = true;
   
       public void configure( final Configuration configuration )
           throws ConfigurationException
  @@ -79,11 +77,6 @@
           m_id = id;
       }
   
  -    public void setLocalScope( final boolean localScope )
  -    {
  -        m_localScope = localScope;
  -    }
  -
       public void execute()
           throws TaskException
       {
  @@ -93,13 +86,6 @@
               throw new TaskException( message );
           }
   
  -        if( m_localScope )
  -        {
  -            getContext().setProperty( m_id, m_value );
  -        }
  -        else
  -        {
  -            getContext().setProperty( m_id, m_value, TaskContext.PARENT );
  -        }
  +        getContext().setProperty( m_id, m_value );
       }
   }
  
  
  

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