You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/06/18 16:23:52 UTC
cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/component ComponentException.java DefaultComponentManager.java DefaultComponentSelector.java
bloritsch 2002/06/18 07:23:51
Modified: src/java/org/apache/avalon/framework/component
ComponentException.java
DefaultComponentManager.java
DefaultComponentSelector.java
Log:
add support for role name in exception
Revision Changes Path
1.5 +33 -2 jakarta-avalon/src/java/org/apache/avalon/framework/component/ComponentException.java
Index: ComponentException.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/ComponentException.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ComponentException.java 11 Dec 2001 09:00:44 -0000 1.4
+++ ComponentException.java 18 Jun 2002 14:23:51 -0000 1.5
@@ -21,24 +21,55 @@
public class ComponentException
extends CascadingException
{
+ private final String m_role;
+
/**
* Construct a new <code>ComponentException</code> instance.
*
* @param message the exception message
* @param throwable the throwable
*/
- public ComponentException( final String message, final Throwable throwable )
+ public ComponentException( final String role, final String message, final Throwable throwable )
{
super( message, throwable );
+ m_role = role;
+ }
+
+ /**
+ * Construct a new <code>ComponentException</code> instance.
+ *
+ * @deprecated use the String, String, Throwable version to record the role
+ * @param message the exception message
+ * @param throwable the throwable
+ */
+ public ComponentException( final String message, final Throwable throwable )
+ {
+ this( null, message, throwable );
}
/**
* Construct a new <code>ComponentException</code> instance.
*
+ * @deprecated use the String, String version to record the role
* @param message the exception message
*/
public ComponentException( final String message )
{
- super( message, null );
+ this( null, message, null );
+ }
+
+ /**
+ * Construct a new <code>ComponentException</code> instance.
+ *
+ * @param message the exception message
+ */
+ public ComponentException( final String role, final String message )
+ {
+ this( role, message, null );
+ }
+
+ public final String getRole()
+ {
+ return m_role;
}
}
1.13 +1 -1 jakarta-avalon/src/java/org/apache/avalon/framework/component/DefaultComponentManager.java
Index: DefaultComponentManager.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/DefaultComponentManager.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DefaultComponentManager.java 14 Jun 2002 13:04:03 -0000 1.12
+++ DefaultComponentManager.java 18 Jun 2002 14:23:51 -0000 1.13
@@ -68,7 +68,7 @@
}
else
{
- throw new ComponentException( "Unable to provide implementation for " + role );
+ throw new ComponentException( role, "Unable to provide implementation." );
}
}
1.11 +1 -2 jakarta-avalon/src/java/org/apache/avalon/framework/component/DefaultComponentSelector.java
Index: DefaultComponentSelector.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/DefaultComponentSelector.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DefaultComponentSelector.java 14 Jun 2002 13:04:03 -0000 1.10
+++ DefaultComponentSelector.java 18 Jun 2002 14:23:51 -0000 1.11
@@ -41,8 +41,7 @@
}
else
{
- throw new ComponentException( "Unable to provide implementation for " +
- hint.toString() );
+ throw new ComponentException( hint.toString(), "Unable to provide implementation." );
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>