You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Grzegorz Kossakowski <gr...@tuffmail.com> on 2007/07/02 22:31:33 UTC

Does configurator:bean-map support Spring aliases?

Hi,

I use configurator:bean-map to grab all Expression languages' compilers:

   <bean id="org.apache.cocoon.components.expression.ExpressionFactory" 
class="org.apache.cocoon.components.expression.DefaultExpressionFactory">
     <property name="expressionCompilers">
       <configurator:bean-map type="org.apache.cocoon.components.expression.ExpressionCompiler"/>
     </property>
   </bean>

Now I would like to define JXPath language as default (it was that way before) so it's quite obvious to define Spring's alias[1] for JXPath 
bean:

<bean name="org.apache.cocoon.components.expression.ExpressionCompiler/jxpath 
org.apache.cocoon.components.expression.ExpressionCompiler/default" class="org.apache.cocoon.components.expression.jxpath.JXPathCompiler"/>

The problem is that bean-map does not add all aliases of bean but only the first one. I guess that it could be fixed by using getAliases 
method[2] and adding all aliases to bean-map.

Do you think that it's a good idea?

[1] http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-beanname
[2] http://www.springframework.org/docs/api/org/springframework/beans/factory/BeanFactory.html#getAliases(java.lang.String)

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/