Hi,
in the last days while converting the portal block from spring to avalon
I added two features to our spring configurator:
1. It's now possible to define default values for properties directly in
the property reference, so you can write a reference to the property
"myproperty" like this: ${myproperty:DEFAULT_VALUE}. If no definition
for the property is found, the default value is used. Of course, it's
possible to use ${myproperty} as well.
2. A new map implementation that collects all defined spring beans
implementing a specified type, so you configure a managing component
like this:
<bean id="mycomponent" class="myclass">
<property name="widgets">
<configurator:bean-map type="o.a.c.Widget"/>
</property>
</bean>
The bean-map element collects all beans for the specified type
(o.a.c.Widget) in this case and creates a Map with the id's of the beans
as keys and the beans itself as the value.
In addition if the bean name starts with the type, like
"o.a.c.Widget/button", the bean will be put under the key "button" into
the Map. (This behaviour can be controlled via an additional attribute).
Carsten
--
Carsten Ziegeler
http://www.osoco.org/weblogs/rael/
|