1 23 24 package org.objectweb.cjdbc.driver.connectpolicy; 25 26 import org.objectweb.cjdbc.common.exceptions.NoMoreControllerException; 27 import org.objectweb.cjdbc.driver.ControllerInfo; 28 import org.objectweb.cjdbc.driver.Driver; 29 30 38 public class SingleConnectPolicy extends AbstractControllerConnectPolicy 39 { 40 41 48 public SingleConnectPolicy(ControllerInfo[] controllerList, int debugLevel) 49 { 50 super(controllerList, Driver.DEFAULT_RETRY_INTERVAL_IN_MS, debugLevel); 51 if (controllerList.length != 1) 52 throw new RuntimeException ("Invalid number of controllers (" 53 + controllerList.length + ") in URL for SingleConnectPolicy"); 54 } 55 56 59 public ControllerInfo getController() throws NoMoreControllerException 60 { 61 if (suspectedControllers.size() == 1) 62 throw new NoMoreControllerException(); 63 return controllerList[0]; 64 } 65 66 } 67 | Popular Tags |