java.util.function.Consumer
either by
being an org.oddjob.beanbus.Outbound
or by marking a setter with the org.oddjob.beanbus.Destination
annotation. Components accept data by being a java.util.function.Consumer
. Components
can be both.
This component parent provides the following features over other component parents such as sequential:
java.util.function.Consumer
will appear in the bus as a service with
appropriate icons and state.java.lang.AutoCloseable
then
one will be set automatically allowing the component to stop the bus.java.io.Flushable
then
one will be set automatically allowing the component to flush the bus.java.io.Flushable
will be flushed when a
component flushes the bus. Flush will be called in component order.
Flush will always be called when the bus stops, unless it crashes.org.oddjob.beanbus.BusConductor
and one will be set automaticallybusConductor | Provides coordination facilities to the components of a bus. |
name | A name, can be any text. |
noAutoLink | Bus components will automatically be linked unless this is true. |
of | The components of a Bus. |
services | Provides services to other components of a bus. |
stop | Read only view of the internal stop flag. |
to | An onward consumer so that bus services may be nested. |
Example 1 | A simple bus of 3 components. |
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
Provides coordination facilities to the components of a bus. Set automatically and exposed for advance use only.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
A name, can be any text.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No, defaults to false. |
Bus components will automatically be linked unless this is true.
Configured By | ELEMENT |
Access | WRITE_ONLY |
Required | No, but pointless if missing. |
The components of a Bus.
Access | READ_ONLY |
Required | Read Only. |
Provides services to other components of a bus. Exposed for advance use only.
Access | READ_ONLY |
Read only view of the internal stop flag. This flag is cleared with a reset.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
An onward consumer so that bus services may be nested.
A simple bus of 3 components.
<oddjob> <job> <bus:bus id="bean-bus" xmlns:bus="oddjob:beanbus"> <of> <bus:driver> <values> <list> <values> <bean class="org.oddjob.beanbus.example.Fruit" quantity="42" type="Apple" price="25.5"/> <bean class="org.oddjob.beanbus.example.Fruit" quantity="24" type="Banana" price="36.2"/> <bean class="org.oddjob.beanbus.example.Fruit" quantity="15" type="Pear" price="40.4"/> </values> </list> </values> </bus:driver> <bus:map> <function> <bean class="org.oddjob.beanbus.example.DoublePrice"/> </function> </bus:map> <bus:collect id="results"/> </of> </bus:bus> </job> </oddjob>