E
- The type of element on the queue.public class BusQueue<E> extends java.lang.Object implements java.util.function.Consumer<E>, java.lang.Iterable<E>, Service
<oddjob> <job> <sequential> <jobs> <variables id="vars"> <results> <list/> </results> </variables> <bean class="org.oddjob.beanbus.destinations.BusQueue" id="queue"/> <parallel id="parallel"> <jobs> <sequential> <jobs> <bean class="org.oddjob.beanbus.drivers.IterableBusDriver" id="producer" name="Producer"> <values> <list> <values> <value value="apple"/> <value value="orange"/> <value value="pear"/> </values> </list> </values> <to> <value value="${queue}"/> </to> </bean> <stop job="${queue}" name="Stop Queue"/> </jobs> </sequential> <bean class="org.oddjob.beanbus.drivers.IterableBusDriver" id="consumer" name="Consumer"> <values> <value value="${queue}"/> </values> <to> <value value="${vars.results}"/> </to> </bean> </jobs> </parallel> </jobs> </sequential> </job> </oddjob>
<oddjob> <job> <parallel id="parallel" join="true"> <jobs> <bus:bus xmlns:bus="oddjob:beanbus"> <of> <bus:driver> <values> <list> <values> <value value="Apple"/> <value value="Orange"/> <value value="Banana"/> <value value="Pear"/> <value value="Kiwi"/> </values> </list> </values> </bus:driver> <bus:queue id="queue"/> </of> </bus:bus> <bus:bus xmlns:bus="oddjob:beanbus"> <of> <bus:driver> <values> <value value="${queue}"/> </values> </bus:driver> <bus:collect id="results"/> </of> </bus:bus> </jobs> </parallel> </job> </oddjob>
Constructor and Description |
---|
BusQueue() |
Modifier and Type | Method and Description |
---|---|
void |
accept(E bean) |
int |
getCapacity() |
java.lang.String |
getName() |
int |
getSize() |
int |
getTaken() |
int |
getWaitingConsumers() |
java.util.Iterator<E> |
iterator() |
void |
onReset() |
void |
setCapacity(int capacity) |
void |
setName(java.lang.String name) |
void |
setPut(E item)
Allows an item to be place on the queue with set property.
|
void |
start()
Start the service.
|
void |
stop()
Stop executing.
|
java.lang.String |
toString() |
public void start()
Service
public void stop()
Stoppable
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
public void onReset()
public int getSize()
Property:
Description: The size of the queue.
Required: Read only.
public java.lang.String getName()
public void setName(java.lang.String name)
public int getTaken()
public void setPut(E item)
item
- An item.public int getCapacity()
public void setCapacity(int capacity)
public int getWaitingConsumers()
public java.lang.String toString()
toString
in class java.lang.Object