proyal 2002/06/13 12:46:35
Modified: fortress/src/java/org/apache/excalibur/fortress
AbstractContainer.java
Log:
* Copy all attributes from original configuration object now.
* Permit overriding of specific attributes while still keeping shorthand name
(you can now use a shorthand to specify a role but still specify a
different
impl class)
Revision Changes Path
1.37 +6 -10
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.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- AbstractContainer.java 13 Jun 2002 17:43:12 -0000 1.36
+++ AbstractContainer.java 13 Jun 2002 19:46:34 -0000 1.37
@@ -186,20 +186,16 @@
+ ", location: " +
configItem.getLocation() + "]" );
}
+ //We set these before copying all other attributes so the class /
handler can be overriden if needed if
+ //the shorthand name is used
temp.setAttribute( "role", role );
temp.setAttribute( "class", klass.getName() );
temp.setAttribute( "handler", handlerKlass.getName() );
- final String id = configItem.getAttribute( "id", null );
- if( null != id )
+ String[] attributes = configItem.getAttributeNames();
+ for( int i = 0; i < attributes.length; i++ )
{
- temp.setAttribute( "id", id );
- }
-
- final String logger = configItem.getAttribute( "logger", null );
- if( null != logger )
- {
- temp.setAttribute( "logger", logger );
+ temp.setAttribute( attributes[i], configItem.getAttribute(
attributes[i] ) );
}
Configuration[] children = configItem.getChildren();
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>