Hi,

I would love to use a syntax like

 <conditions>
  <condition name="cond1" value="i&lt;5"/>
  <condition name="cond2" class="org.domain.FileChanged"/>
 </conditions>

with the ExcaliburCompoenentSelector.

 <role name="org.domain.ConditionSelector"
       shorthand="conditions"
       
default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector">
  <hint shorthand="condition" class="org.domain.ExpressionCondition"/>
 </role>

But the ECS only allows 'component-instance' with a class attribute
or a defined element name and using the class specified the
the hint role. It is perhaps possible to change the implementation
to use the class attribute in other elements than
'component-instance'?

I attached a patch file for the ECS.

Thank you, Stephan Michels.

_______________________________________________________________________
         Stephan Michels               EMail: [EMAIL PROTECTED]
         ICQ: 115535699                Tel: +49-030-314-21583
----+----|----+----|----+----|----+----|----+----|----+----|----+----|-|
Index: ExcaliburComponentSelector.java
===================================================================
RCS file: 
/home/cvspublic/avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentSelector.java,v
retrieving revision 1.21
diff -u -r1.21 ExcaliburComponentSelector.java
--- ExcaliburComponentSelector.java     25 Feb 2003 16:28:21 -0000      1.21
+++ ExcaliburComponentSelector.java     14 Mar 2003 10:18:09 -0000
@@ -392,17 +392,8 @@
         for( int i = 0; i < instances.length; i++ )
         {
             final Object hint = instances[ i ].getAttribute( "name" ).trim();
-            final String className;
-
-            if( "component-instance".equals( instances[ i ].getName() ) )
-            {
-                className = (String)instances[ i ].getAttribute( "class" ).trim();
-            }
-            else
-            {
-                className = m_roles.getDefaultClassNameForHint( m_rolename,
-                                                                instances[ i 
].getName() );
-            }
+            final String className = (String)instances[ i ].getAttribute( "class" , 
+                m_roles.getDefaultClassNameForHint( m_rolename, instances[ i 
].getName() ) ).trim();
 
             try
             {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to