|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jboss.messaging.core.local.RoundRobinPointToPointRouter
This router deliver the reference to a maximum of one of the router's receivers. The router will always first try the next receiver in the list to the one it tried last time This gives a more balanced distribution than the FirstReceiverPointToPointRouter and is better suited when batching messages to consumers since we will end up with messages interleaved amongst consumers rather than in contiguous blocks.
| Field Summary | |
protected java.util.ArrayList |
receivers
|
protected int |
target
|
| Constructor Summary | |
RoundRobinPointToPointRouter()
|
|
| Method Summary | |
boolean |
add(Receiver r)
Add a local receiver to this distributor. |
void |
clear()
Remove all receivers. |
boolean |
contains(Receiver r)
|
java.util.Set |
handle(DeliveryObserver observer,
Routable routable,
Transaction tx)
Returns a set of Delivery instances. |
java.util.Iterator |
iterator()
|
boolean |
remove(Receiver r)
Remove a local receiver from this distributor. |
protected void |
shiftTarget(int currentTarget)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.ArrayList receivers
protected int target
| Constructor Detail |
public RoundRobinPointToPointRouter()
| Method Detail |
public java.util.Set handle(DeliveryObserver observer,
Routable routable,
Transaction tx)
Router
handle in interface Routerpublic boolean add(Receiver r)
Distributor
add in interface Distributorpublic boolean remove(Receiver r)
Distributor
remove in interface Distributorpublic void clear()
Distributor
clear in interface Distributorpublic boolean contains(Receiver r)
contains in interface Distributorpublic java.util.Iterator iterator()
iterator in interface Distributorprotected void shiftTarget(int currentTarget)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||