org.objectweb.cjdbc.driver.connectpolicy
Class RoundRobinConnectPolicy
java.lang.Object
org.objectweb.cjdbc.driver.connectpolicy.AbstractControllerConnectPolicy
org.objectweb.cjdbc.driver.connectpolicy.RoundRobinConnectPolicy
- public class RoundRobinConnectPolicy
- extends AbstractControllerConnectPolicy
This class defines a RoundRobinConnectPolicy used when the C-JDBC URL has the
following form:
jdbc:cjdbc://node1,node2,node3/myDB?preferredController=roundRobin
Round robin starts with the first node in URL.
- Version:
- 1.0
- Author:
- Emmanuel Cecchet
Field Summary |
private int |
index
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
index
private int index
RoundRobinConnectPolicy
public RoundRobinConnectPolicy(ControllerInfo[] controllerList,
long retryIntervalInMs,
int debugLevel)
- Creates a new
RandomConnectPolicy
object
- Parameters:
controllerList
- list of controller from C-JDBC urlretryIntervalInMs
- Interval in milliseconds before retrying to
re-connect to a controller that has faileddebugLevel
- the debug level to use- See Also:
CjdbcUrl.DEBUG_LEVEL_OFF
getController
public ControllerInfo getController()
throws NoMoreControllerException
- Description copied from class:
AbstractControllerConnectPolicy
- Get a controller using the implementation specific policy
- Specified by:
getController
in class AbstractControllerConnectPolicy
- Returns:
ControllerInfo
of the selected controller
- Throws:
NoMoreControllerException
- if no controller in the controller list
is reachable- See Also:
AbstractControllerConnectPolicy.getController()
Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.