proyal 02/04/24 11:31:14
Modified: fortress/src/java/org/apache/excalibur/fortress
AbstractContainer.java
Log:
* Throw an exception when rewriting configuration if name is not found in
roles
* Carry over the logger attribute when rewriting configuration
* No longer print stack trace to System.err when failing to find a component
Revision Changes Path
1.31 +15 -2
jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/AbstractContainer.java
Index: AbstractContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/AbstractContainer.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- AbstractContainer.java 13 Apr 2002 01:39:56 -0000 1.30
+++ AbstractContainer.java 24 Apr 2002 18:31:14 -0000 1.31
@@ -43,7 +43,8 @@
* Manager can expose that to the instantiating class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.30 $ $Date: 2002/04/13 01:39:56 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Peter Royal</a>
+ * @version CVS $Revision: 1.31 $ $Date: 2002/04/24 18:31:14 $
*/
public abstract class AbstractContainer
extends AbstractLogEnabled
@@ -174,6 +175,12 @@
Class handlerKlass = m_roleManager.getHandlerClassForClass( klass );
String role = m_roleManager.getRoleForClass( klass );
+ if( null == klass )
+ {
+ throw new ConfigurationException( "No class found matching
configuration name " +
+ "[name: " +
configItem.getName() + ", location: " + configItem.getLocation() + "]" );
+ }
+
temp.setAttribute( "role", role );
temp.setAttribute( "class", klass.getName() );
temp.setAttribute( "handler", handlerKlass.getName() );
@@ -184,6 +191,12 @@
temp.setAttribute( "id", id );
}
+ final String logger = configItem.getAttribute( "logger", null );
+ if ( null != logger )
+ {
+ temp.setAttribute( "logger", logger );
+ }
+
Configuration[] children = configItem.getChildren();
for( int i = 0; i < children.length; i++ )
{
@@ -506,7 +519,7 @@
}
catch( ComponentException ce )
{
- ce.printStackTrace( System.err );
+// ce.printStackTrace( System.err );
if( null != m_parent )
{
return m_parent.lookup( role );
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>