1 26 27 package org.objectweb.jonas.ant.cluster; 28 29 import java.io.File ; 30 import org.objectweb.jonas.ant.jonasbase.JdbcRa; 31 32 36 public class JdbcRaCluster extends ClusterTasks { 37 38 41 private static final String INFO = "[JdbcRaCluster] "; 42 43 46 private String name = null; 47 48 51 private String mapperName = null; 52 53 56 private String user = null; 57 58 61 private String password = null; 62 63 66 private String url = null; 67 68 71 private String driverName = null; 72 73 76 private String realDriverName = null; 77 78 81 private String maxPoolSize = "100"; 82 83 86 private String jndiName = null; 87 88 91 private boolean autoload = true; 92 93 96 private boolean p6spy = false; 97 100 public JdbcRaCluster() { 101 super(); 102 } 103 104 108 public void setName(String name) { 109 this.name = name; 110 } 111 112 116 public void setMapperName(String mapperName) { 117 this.mapperName = mapperName; 118 } 119 120 124 public void setUser(String user) { 125 this.user = user; 126 } 127 128 132 public void setPassword(String password) { 133 this.password = password; 134 } 135 136 140 public void setUrl(String url) { 141 this.url = url; 142 } 143 144 148 public void setMaxPoolSize(String maxPoolSize) { 149 this.maxPoolSize = maxPoolSize; 150 } 151 152 156 public void setDriverName(String driverName) { 157 this.driverName = driverName; 158 this.realDriverName = driverName; 159 } 160 161 165 public void setJndiName(String jndiName) { 166 this.jndiName = jndiName; 167 } 168 169 173 public void setAutoload(boolean autoload) { 174 this.autoload = autoload; 175 } 176 177 181 public void setP6spy(boolean p6spy) { 182 this.p6spy = p6spy; 183 } 184 185 188 public void generatesTasks() { 189 190 int portInd = 0; 191 192 for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) { 193 194 String destDir = getDestDir(getDestDirPrefix(), i); 195 log(INFO + "tasks generation for " + destDir); 196 JdbcRa jdbcRa = new JdbcRa(); 198 199 jdbcRa.setAutoload(autoload); 200 jdbcRa.setDriverName(driverName); 201 jdbcRa.setJndiName(jndiName); 202 jdbcRa.setMapperName(mapperName); 203 jdbcRa.setMaxPoolSize(maxPoolSize); 204 jdbcRa.setName(name); 205 jdbcRa.setP6spy(p6spy); 206 jdbcRa.setPassword(password); 207 jdbcRa.setUrl(url); 208 jdbcRa.setUser(user); 209 210 jdbcRa.setDestDir(new File (destDir)); 211 212 addTask(jdbcRa); 213 214 portInd++; 215 216 } 217 } 218 } | Popular Tags |