org.objectweb.carol.cmi
Class RoundRobin

java.lang.Object
  extended byorg.objectweb.carol.cmi.RoundRobin

public class RoundRobin
extends java.lang.Object

You can use this helper class to get a round robin load balacing algorithm between clustered servers.

Author:
Simon Nieuviarts

Constructor Summary
RoundRobin()
          Constructor
RoundRobin(java.util.Set c)
          Builds a round robin algorithm on a Collection of StubData objects.
 
Method Summary
 StubData get()
          Get a stub according to the RR algorithm
 void update(java.util.Set stubs)
          Update the set of stubs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobin

public RoundRobin()
Constructor


RoundRobin

public RoundRobin(java.util.Set c)
Builds a round robin algorithm on a Collection of StubData objects.

Parameters:
c - a Collection of StubData objects.
Method Detail

update

public void update(java.util.Set stubs)
Update the set of stubs

Parameters:
stubs - new set of stubs

get

public StubData get()
             throws NoServerException
Get a stub according to the RR algorithm

Returns:
stub data
Throws:
NoServerException - if no stub available