org.objectweb.cjdbc.controller.loadbalancer.policies.errorchecking
Class ErrorCheckingRoundRobin

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.loadbalancer.policies.errorchecking.ErrorCheckingPolicy
      extended byorg.objectweb.cjdbc.controller.loadbalancer.policies.errorchecking.ErrorCheckingRoundRobin

public class ErrorCheckingRoundRobin
extends ErrorCheckingPolicy

Chooses the number of nodes nodes for error checking using a round-robin algorithm.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
private  int index
          Round-robin index.
 
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.policies.errorchecking.ErrorCheckingPolicy
ALL, nbOfNodes, policy, RANDOM, ROUND_ROBIN
 
Constructor Summary
ErrorCheckingRoundRobin(int numberOfNodes)
          Creates a new ErrorCheckingRoundRobin instance.
 
Method Summary
 java.util.ArrayList getBackends(java.util.ArrayList backends)
          Pickups backends from the given backends arraylist according to the current rule policy.
 java.lang.String getInformation()
          Gives information about the current policy.
 
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.policies.errorchecking.ErrorCheckingPolicy
getNumberOfNodes, getPolicy, getXml, setNumberOfNodes, setPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

private int index
Round-robin index.

Constructor Detail

ErrorCheckingRoundRobin

public ErrorCheckingRoundRobin(int numberOfNodes)
Creates a new ErrorCheckingRoundRobin instance.

Parameters:
numberOfNodes - number of nodes
Method Detail

getBackends

public java.util.ArrayList getBackends(java.util.ArrayList backends)
                                throws ErrorCheckingException
Description copied from class: ErrorCheckingPolicy
Pickups backends from the given backends arraylist according to the current rule policy.

Specified by:
getBackends in class ErrorCheckingPolicy
Parameters:
backends - backends to choose from
Returns:
Arraylist of choosen DatabaseBackend
Throws:
ErrorCheckingException - if the rule cannot be applied
See Also:
ErrorCheckingPolicy.getBackends(ArrayList)

getInformation

public java.lang.String getInformation()
Description copied from class: ErrorCheckingPolicy
Gives information about the current policy.

Specified by:
getInformation in class ErrorCheckingPolicy
Returns:
a String value
See Also:
ErrorCheckingPolicy.getInformation()


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.