Elements can declare inbeans and outbeans with a name. This allows other parts of RIFE to refer to these beans without having to write the full classname and making sure that the same prefix is used.
Datalinks, most notably, benefit a lot from this. Instead of having to specify a datalink for every bean property, it's now possible to directly link an outbean to an inbean.
Consider the following elements:
<element implementation="sample.Source">
<outbean name="outbean1" classname="sample.BeanImpl" prefix="pre_"/>
<exit name="beanexit"/>
</element>
<element implementation="sample.Destination">
<inbean name="inbean1" classname="sample.BeanImpl" prefix="pre_"/>
</element>
A site structure is now able to declare the following datalink:
<element id="SOURCE" file="sample/source.xml" url="/sample">
<flowlink srcexit="beanexit" destid="DEST"/>
<datalink srcoutbean="outbean1" destid="DEST" destinbean="inbean1"/>
</element>
<element id="DEST" file="sample/destination.xml"/>
Elements are now also able to benefit from named inbeans and outbeans thanks to the following new methods:
protected <BeanType> BeanType getNamedInputBean(String name)
protected void setNamedOutputBean(String name, Object bean)
protected void clearNamedOutputBean(String name)
Their usage should be self-explanatory.