adammurdoch 02/03/26 23:01:04
Modified: proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type
TypeException.java
proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service
AntServiceException.java
proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/role
RoleException.java
proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer
DeploymentException.java
proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/builder
ProjectException.java
Added: proposal/myrmidon/src/java/org/apache/myrmidon/interfaces
ComponentException.java
Log:
Extracted out a superclass from the exceptions in myrmidon.interfaces.*, to
make it a little easier to add new exceptions to the interfaces packages.
Revision Changes Path
1.1
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/ComponentException.java
Index: ComponentException.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.myrmidon.interfaces;
/**
* An exception thrown by a Myrmidon component. This is a convenience
* class, which can be sub-classes to create exceptions for specific
components.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2002/03/27 07:01:04 $
*/
public class ComponentException
extends Exception
{
/**
* The Throwable that caused this exception to be thrown.
*/
private final Throwable m_throwable;
/**
* Constructs a non-cascaded exception.
*
* @param message The detail message for this exception.
*/
public ComponentException( final String message )
{
this( message, null );
}
/**
* Constructs a cascaded exception.
*
* @param message The detail message for this exception.
* @param throwable the root cause of the exception
*/
public ComponentException( final String message, final Throwable
throwable )
{
super( message );
m_throwable = throwable;
}
/**
* Retrieve root cause of the exception.
*
* @return the root cause
*/
public final Throwable getCause()
{
return m_throwable;
}
}
1.6 +8 -22
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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TypeException.java 1 Mar 2002 10:33:38 -0000 1.5
+++ TypeException.java 27 Mar 2002 07:01:04 -0000 1.6
@@ -7,49 +7,35 @@
*/
package org.apache.myrmidon.interfaces.type;
+import org.apache.myrmidon.interfaces.ComponentException;
+
/**
* Exception to indicate problem with type instantiating.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.5 $ $Date: 2002/03/01 10:33:38 $
+ * @version $Revision: 1.6 $ $Date: 2002/03/27 07:01:04 $
*/
public final class TypeException
- extends Exception
+ extends ComponentException
{
/**
- * The Throwable that caused this exception to be thrown.
- */
- private final Throwable m_throwable;
-
- /**
- * Construct a new <code>TypeException</code> instance.
+ * Constructs a non-cascaded exception.
*
* @param message The detail message for this exception.
*/
public TypeException( final String message )
{
- this( message, null );
+ super( message );
}
/**
- * Construct a new <code>TypeException</code> instance.
+ * Constructs a cascaded exception.
*
* @param message The detail message for this exception.
* @param throwable the root cause of the exception
*/
public TypeException( final String message, final Throwable throwable )
{
- super( message );
- m_throwable = throwable;
- }
-
- /**
- * Retrieve root cause of the exception.
- *
- * @return the root cause
- */
- public final Throwable getCause()
- {
- return m_throwable;
+ super( message, throwable );
}
}
1.3 +11 -33
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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AntServiceException.java 1 Mar 2002 10:33:37 -0000 1.2
+++ AntServiceException.java 27 Mar 2002 07:01:04 -0000 1.3
@@ -7,59 +7,37 @@
*/
package org.apache.myrmidon.interfaces.service;
+import org.apache.myrmidon.interfaces.ComponentException;
+
/**
* ServiceException thrown when a service can not be created for
* some reason.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.2 $ $Date: 2002/03/01 10:33:37 $
+ * @version $Revision: 1.3 $ $Date: 2002/03/27 07:01:04 $
*/
public class AntServiceException
- extends Exception
+ extends ComponentException
{
/**
- * 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()
- {
- this( "", null );
- }
-
- /**
- * Basic constructor with a message
+ * Constructs a non-cascaded exception.
*
- * @param message the message
+ * @param message The detail message for this exception.
*/
public AntServiceException( 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 AntServiceException( final String message, final Throwable
throwable )
- {
super( message );
- m_throwable = throwable;
}
/**
- * Retrieve root cause of the exception.
+ * Constructs a cascaded exception.
*
- * @return the root cause
+ * @param message The detail message for this exception.
+ * @param throwable the root cause of the exception
*/
- public final Throwable getCause()
+ public AntServiceException( final String message, final Throwable
throwable )
{
- return m_throwable;
+ super( message, throwable );
}
}
1.3 +12 -16
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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RoleException.java 1 Mar 2002 10:33:38 -0000 1.2
+++ RoleException.java 27 Mar 2002 07:01:04 -0000 1.3
@@ -7,39 +7,35 @@
*/
package org.apache.myrmidon.interfaces.role;
+import org.apache.myrmidon.interfaces.ComponentException;
+
/**
* An exception thrown by the RoleManager.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
- * @version $Revision: 1.2 $ $Date: 2002/03/01 10:33:38 $
+ * @version $Revision: 1.3 $ $Date: 2002/03/27 07:01:04 $
*/
public class RoleException
- extends Exception
+ extends ComponentException
{
/**
- * The Throwable that caused this exception to be thrown.
+ * Constructs a non-cascaded exception.
+ *
+ * @param message The detail message for this exception.
*/
- private final Throwable m_throwable;
-
public RoleException( final String message )
{
- this( message, null );
- }
-
- public RoleException( final String message,
- final Throwable throwable )
- {
super( message );
- m_throwable = throwable;
}
/**
- * Retrieve root cause of the exception.
+ * Constructs a cascaded exception.
*
- * @return the root cause
+ * @param message The detail message for this exception.
+ * @param throwable the root cause of the exception
*/
- public final Throwable getCause()
+ public RoleException( final String message, final Throwable throwable )
{
- return m_throwable;
+ super( message, throwable );
}
}
1.6 +9 -23
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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DeploymentException.java 1 Mar 2002 10:33:37 -0000 1.5
+++ DeploymentException.java 27 Mar 2002 07:01:04 -0000 1.6
@@ -7,49 +7,35 @@
*/
package org.apache.myrmidon.interfaces.deployer;
+import org.apache.myrmidon.interfaces.ComponentException;
+
/**
* Exception to indicate error deploying.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.5 $ $Date: 2002/03/01 10:33:37 $
+ * @version $Revision: 1.6 $ $Date: 2002/03/27 07:01:04 $
*/
-public final class DeploymentException
- extends Exception
+public class DeploymentException
+ extends ComponentException
{
/**
- * The Throwable that caused this exception to be thrown.
- */
- private final Throwable m_throwable;
-
- /**
- * Construct a new <code>DeploymentException</code> instance.
+ * Constructs a non-cascaded exception.
*
* @param message The detail message for this exception.
*/
public DeploymentException( final String message )
{
- this( message, null );
+ super( message );
}
/**
- * Construct a new <code>DeploymentException</code> instance.
+ * Constructs a cascaded exception.
*
* @param message The detail message for this exception.
* @param throwable the root cause of the exception
*/
public DeploymentException( final String message, final Throwable
throwable )
{
- super( message );
- m_throwable = throwable;
- }
-
- /**
- * Retrieve root cause of the exception.
- *
- * @return the root cause
- */
- public final Throwable getCause()
- {
- return m_throwable;
+ super( message, throwable );
}
}
1.2 +11 -26
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/builder/ProjectException.java
Index: ProjectException.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/builder/ProjectException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ProjectException.java 11 Mar 2002 06:07:24 -0000 1.1
+++ ProjectException.java 27 Mar 2002 07:01:04 -0000 1.2
@@ -7,50 +7,35 @@
*/
package org.apache.myrmidon.interfaces.builder;
+import org.apache.myrmidon.interfaces.ComponentException;
+
/**
* A cascading exception thrown on a problem constructing a Project model.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Darrell DeBoer</a>
- * @version $Revision: 1.1 $ $Date: 2002/03/11 06:07:24 $
+ * @version $Revision: 1.2 $ $Date: 2002/03/27 07:01:04 $
*/
public class ProjectException
- extends Exception
+ extends ComponentException
{
/**
- * If this exception is cascaded, the cause of this exception.
- */
- private final Throwable m_throwable;
-
- /**
- * Constructs an non-cascaded exception with a message
+ * Constructs a non-cascaded exception.
*
- * @param message the message
+ * @param message The detail message for this exception.
*/
public ProjectException( final String message )
{
- this( message, null );
- }
-
- /**
- * Constructs a cascaded exception with the supplied message, which
links the
- * Throwable provided.
- *
- * @param message the message
- * @param throwable the throwable that caused this exception
- */
- public ProjectException( final String message, final Throwable throwable
)
- {
super( message );
- m_throwable = throwable;
}
/**
- * Retrieve root cause of the exception.
+ * Constructs a cascaded exception.
*
- * @return the root cause
+ * @param message The detail message for this exception.
+ * @param throwable the root cause of the exception
*/
- public final Throwable getCause()
+ public ProjectException( final String message, final Throwable throwable
)
{
- return m_throwable;
+ super( message, throwable );
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>