KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > server > journal > impl > RoundRobinArbiter


1 package com.ubermq.jms.server.journal.impl;
2
3 /**
4  * Selects among multiple connections in a round-robin fashion, i.e. every
5  * connection gets chosen in a predetermined order until they are all chosen,
6  * then the order repeats.
7  */

8 public final class RoundRobinArbiter
9     extends AbstractMultipleArbiter
10 {
11     private int n;
12     protected int chooseNode(int nNodes)
13     {
14         return (n++ % nNodes);
15     }
16
17     public String JavaDoc toHtml()
18     {
19         return "<B>Round Robin Delivery</b><P>" + super.toHtml();
20     }
21 }
22
Popular Tags