[Index]

bus:bus


Links components in a data pipeline. Components provide data by accepting an 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:


Property Summary

busConductor 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 Summary

Example 1 A simple bus of 3 components.

Property Detail

busConductor

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

Provides coordination facilities to the components of a bus. Set automatically and exposed for advance use only.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

noAutoLink

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to false.

Bus components will automatically be linked unless this is true.

of

Configured ByELEMENT
AccessWRITE_ONLY
RequiredNo, but pointless if missing.

The components of a Bus.

services

AccessREAD_ONLY
RequiredRead Only.

Provides services to other components of a bus. Exposed for advance use only.

stop

AccessREAD_ONLY

Read only view of the internal stop flag. This flag is cleared with a reset.

to

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

An onward consumer so that bus services may be nested.


Examples

Example 1

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>


(c) R Gordon Ltd 2005 - Present