[Index]

bus:limit


Only allow a certain number of beans passed. When the limit is reached the Bus will be Stopped. Any beans arriving while the bus is stopping will be ignored.

Property Summary

count The number so far.
limit The limit.
name The name of this component.
to The next component in a bus.

Example Summary

Example 1 Limit the Bus to 2 beans.

Property Detail

count

AccessREAD_ONLY
RequiredRead only.

The number so far.

limit

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to 0.

The limit.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of this component.

to

Configured ByELEMENT
AccessWRITE_ONLY
RequiredNo.

The next component in a bus. Set automatically in a bus:bus.


Examples

Example 1

Limit the Bus to 2 beans.

<oddjob>
    <job>
        <bus:bus id="bean-bus" xmlns:bus="oddjob:beanbus">
            <of>
                <bus:driver>
                    <values>
                        <list>
                            <values>
                                <value value="Apple"/>
                                <value value="Orange"/>
                                <value value="Banana"/>
                            </values>
                        </list>
                    </values>
                </bus:driver>
                <bus:collect id="before" name="Beans Before"/>
                <bus:limit id="only-filter" limit="2"/>
                <bus:collect id="results" name="Beans After"/>
            </of>
        </bus:bus>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present