[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
Property Detail
count
Access | READ_ONLY |
Required | Read only. |
The number so far.
limit
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No, defaults to 0. |
The limit.
name
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The name of this component.
to
Configured By | ELEMENT |
Access | WRITE_ONLY |
Required | No. |
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