|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.commons.executors.PRRNextQueueAlgorithm<E>
public class PRRNextQueueAlgorithm<E>
This is a priority based round robin algorithm for getting the next queue
This algorithm works in cycles. Lets say we have queues with following priorities. 7, 5, 2 and assume we name the queues as 1, 2, 3 in the order.
Here is how messages are picked in a single cycle
1, 1, 1, 1, 1, 1, 1 all the messages for the queue with priority 1 are sent for this cycle 2, 2, 2, 2, 2, all the messages for the queue with priority 2 are sent for this cycle 3, 3 all the messages with priority 2 are sent for this cycle
This algorithm choose the queues in the above order if all the queues have messages at the point of selection. If a queue doesn't have messages it will skip the queue and move to the next. If none of the queues have messages it will return null.
| Constructor Summary | |
|---|---|
PRRNextQueueAlgorithm()
|
|
| Method Summary | |
|---|---|
InternalQueue<E> |
getNextQueue()
Should return a queue based on some selection criteria and current state of the queues. |
void |
init(List<InternalQueue<E>> queues)
Initialized with the queues sorted according to the priority. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PRRNextQueueAlgorithm()
| Method Detail |
|---|
public InternalQueue<E> getNextQueue()
NextQueueAlgorithm
getNextQueue in interface NextQueueAlgorithm<E>public void init(List<InternalQueue<E>> queues)
NextQueueAlgorithm
init in interface NextQueueAlgorithm<E>queues - list of queues
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||