|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.messaging.core.impl.RoundRobinDistributor
public class RoundRobinDistributor
The distributor 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 FirstReceiverDistributor and is better suited when batching messages to consumers since we will end up with messages interleaved amongst consumers rather than in contiguous blocks.
Constructor Summary | |
---|---|
RoundRobinDistributor()
|
Method Summary | |
---|---|
boolean |
add(Receiver r)
Add a local receiver to this distributor. |
void |
clear()
Remove all receivers. |
boolean |
contains(Receiver r)
Does the distributor already contain the specified Receiver? |
int |
getNumberOfReceivers()
|
Delivery |
handle(DeliveryObserver observer,
MessageReference ref,
Transaction tx)
A receiver can return an active, "done" or null delivery. |
java.util.Iterator |
iterator()
|
boolean |
remove(Receiver r)
Remove a local receiver from this distributor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RoundRobinDistributor()
Method Detail |
---|
public Delivery handle(DeliveryObserver observer, MessageReference ref, Transaction tx)
Receiver
handle
in interface Receiver
observer
- - the component the delivery should be acknowledged to.Delivery
,
DeliveryObserver
public boolean add(Receiver r)
Distributor
add
in interface Distributor
public boolean remove(Receiver r)
Distributor
remove
in interface Distributor
public void clear()
Distributor
clear
in interface Distributor
public boolean contains(Receiver r)
Distributor
contains
in interface Distributor
public java.util.Iterator iterator()
iterator
in interface Distributor
public int getNumberOfReceivers()
getNumberOfReceivers
in interface Distributor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |