Dashboard > RIFE > ... > Web engine > Named beans in datalinks
RIFE Log In | Sign Up   View a printable version of the current page.
Named beans in datalinks


Added by Geert Bevin, last edited by Geert Bevin on May 14, 2004  (view change)
Labels: 
(None)

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.



Are you enjoying Confluence? Please consider purchasing it today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.1a Build:#515 May 19, 2006) - Bug/feature request - Contact Administrators