diff --git a/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java b/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java
index 2d459abad..facf2e55d 100644
--- a/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java
+++ b/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java
@@ -10,7 +10,6 @@ package org.apache.antlib.core;
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;
@@ -31,18 +30,12 @@ public class Property
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 @@ public class Property
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 );
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterException.java b/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterException.java
index e483cfbeb..e66d57bb3 100644
--- a/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterException.java
+++ b/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterException.java
@@ -7,8 +7,6 @@
*/
package org.apache.aut.converter;
-import org.apache.avalon.framework.CascadingException;
-
/**
* ConverterException thrown when a problem occurs during convertion etc.
*
@@ -16,8 +14,13 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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
*
@@ -36,7 +39,18 @@ public class ConverterException
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/aut/manifest/ManifestException.java b/proposal/myrmidon/src/java/org/apache/aut/manifest/ManifestException.java
index 77d32db32..bdd515d6d 100644
--- a/proposal/myrmidon/src/java/org/apache/aut/manifest/ManifestException.java
+++ b/proposal/myrmidon/src/java/org/apache/aut/manifest/ManifestException.java
@@ -7,8 +7,6 @@
*/
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.
@@ -17,8 +15,13 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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
*/
@@ -45,6 +48,17 @@ public class ManifestException
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/aut/nativelib/ExecException.java b/proposal/myrmidon/src/java/org/apache/aut/nativelib/ExecException.java
index 77aa7f513..c881385a9 100644
--- a/proposal/myrmidon/src/java/org/apache/aut/nativelib/ExecException.java
+++ b/proposal/myrmidon/src/java/org/apache/aut/nativelib/ExecException.java
@@ -7,16 +7,19 @@
*/
package org.apache.aut.nativelib;
-import org.apache.avalon.framework.CascadingException;
-
/**
* ExecException indicates there was an error executing native process.
*
* @author Peter Donald
*/
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
*/
@@ -43,7 +46,18 @@ public class ExecException
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/FileSystemException.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/FileSystemException.java
index 8ac918f29..63cb711ef 100644
--- a/proposal/myrmidon/src/java/org/apache/aut/vfs/FileSystemException.java
+++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/FileSystemException.java
@@ -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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java b/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java
index 87554c9eb..ae715369a 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskException.java
@@ -7,8 +7,6 @@
*/
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.
@@ -18,8 +16,13 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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
*/
@@ -46,7 +49,18 @@ public class TaskException
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
index ce82d3f78..1efbf35ef 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
@@ -17,7 +17,6 @@ import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.avalon.excalibur.util.StringUtil;
-import org.apache.avalon.framework.CascadingException;
import org.apache.avalon.framework.Version;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -57,7 +56,6 @@ public class DefaultProjectBuilder
*
* @param source the source
* @return the constructed Project
- * @exception IOException if an error occurs
* @exception Exception if an error occurs
*/
public Project build( final String source )
@@ -115,7 +113,7 @@ public class DefaultProjectBuilder
* @param file the file from which configuration was loaded
* @param configuration the configuration loaded
* @return the created Project
- * @exception IOException if an error occurs
+ * @exception Exception if an error occurs
* @exception Exception if an error occurs
* @exception ConfigurationException if an error occurs
*/
@@ -172,7 +170,7 @@ public class DefaultProjectBuilder
* Throw exceptions with meaningful errors if malformed or missing.
*/
private Version getVersion( final Configuration configuration )
- throws CascadingException
+ throws Exception
{
try
{
@@ -182,7 +180,7 @@ public class DefaultProjectBuilder
catch( final ConfigurationException ce )
{
final String message = REZ.getString( "ant.version-missing.error" );
- throw new CascadingException( message, ce );
+ throw new ConfigurationException( message, ce );
}
}
@@ -190,7 +188,7 @@ public class DefaultProjectBuilder
* Utility function to extract version
*/
private Version parseVersion( final String versionString )
- throws CascadingException
+ throws Exception
{
try
@@ -202,7 +200,7 @@ public class DefaultProjectBuilder
final String message =
REZ.getString( "ant.malformed.version", versionString );
getLogger().warn( message );
- throw new CascadingException( message, e );
+ throw new ConfigurationException( message, e );
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java
index 5eb6ccb1e..eefe3b4fa 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java
@@ -13,7 +13,6 @@ import org.apache.avalon.framework.configuration.Configurable;
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;
/**
@@ -31,7 +30,6 @@ public class TypeInstanceTask
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 @@ public class TypeInstanceTask
m_id = id;
}
- public void setLocalScope( final boolean localScope )
- {
- m_localScope = localScope;
- }
-
public void execute()
throws TaskException
{
@@ -93,13 +86,6 @@ public class TypeInstanceTask
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 );
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/DeploymentException.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/DeploymentException.java
index 6e7199ebd..98fc7cbed 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/DeploymentException.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/DeploymentException.java
@@ -7,8 +7,6 @@
*/
package org.apache.myrmidon.interfaces.deployer;
-import org.apache.avalon.framework.CascadingException;
-
/**
* Exception to indicate error deploying.
*
@@ -16,8 +14,13 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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 DeploymentException
instance.
*
@@ -36,6 +39,17 @@ public final class DeploymentException
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role/RoleException.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role/RoleException.java
index fde1b49ec..1cdf75f24 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role/RoleException.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role/RoleException.java
@@ -7,8 +7,6 @@
*/
package org.apache.myrmidon.interfaces.role;
-import org.apache.avalon.framework.CascadingException;
-
/**
* An exception thrown by the RoleManager.
*
@@ -16,15 +14,32 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/AntServiceException.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/AntServiceException.java
index aa2132185..cf77eba13 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/AntServiceException.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/AntServiceException.java
@@ -7,8 +7,6 @@
*/
package org.apache.myrmidon.interfaces.service;
-import org.apache.avalon.framework.CascadingException;
-
/**
* ServiceException thrown when a service can not be created for
* some reason.
@@ -17,8 +15,13 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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
*/
@@ -45,7 +48,18 @@ public class AntServiceException
*/
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;
}
}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/TypeException.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/TypeException.java
index 83a2a43d5..ce12251c9 100644
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/TypeException.java
+++ b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/TypeException.java
@@ -7,8 +7,6 @@
*/
package org.apache.myrmidon.interfaces.type;
-import org.apache.avalon.framework.CascadingException;
-
/**
* Exception to indicate problem with type instantiating.
*
@@ -16,8 +14,13 @@ import org.apache.avalon.framework.CascadingException;
* @version $Revision$ $Date$
*/
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 TypeException
instance.
*
@@ -36,6 +39,17 @@ public final class TypeException
*/
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;
}
}