1 24 package org.objectweb.jonas.resource; 25 26 27 33 public class ConnectionManagerPoolParams { 34 35 38 static final int SECS_PER_MIN = 60; 39 42 static final int INIT_PSTMT_SIZE = 10; 43 46 static final int INIT_SAMPLING_TIME = 30; 47 50 private int poolInit = 0; 51 54 private int poolMin = 0; 55 58 private int poolMax = -1; 59 62 private long poolMaxAge = 0L; 63 66 private int poolMaxAgeMinutes = 0; 67 70 private int poolMaxOpentime = 0; 71 74 private int poolMaxWaiters = 0; 75 78 private int poolMaxWaittime = 0; 79 82 private int poolSamplingPeriod = INIT_SAMPLING_TIME; 83 86 private int pstmtMax = INIT_PSTMT_SIZE; 87 90 private int jdbcConnLevel = 0; 91 94 private String jdbcConnTestStmt = ""; 95 96 97 101 public ConnectionManagerPoolParams() { 102 } 103 104 108 public ConnectionManagerPoolParams(ConnectionManagerPoolParams cmpp) { 109 poolInit = cmpp.getPoolInit(); 110 poolMin = cmpp.getPoolMin(); 111 poolMax = cmpp.getPoolMax(); 112 poolMaxAge = cmpp.getPoolMaxAge(); 113 poolMaxAgeMinutes = cmpp.getPoolMaxAgeMinutes(); 114 poolMaxOpentime = cmpp.getPoolMaxOpentime(); 115 poolMaxWaiters = cmpp.getPoolMaxWaiters(); 116 poolMaxWaittime = cmpp.getPoolMaxWaittime(); 117 poolSamplingPeriod = cmpp.getPoolSamplingPeriod(); 118 pstmtMax = cmpp.getPstmtMax(); 119 jdbcConnLevel = cmpp.getJdbcConnLevel(); 120 jdbcConnTestStmt = cmpp.getJdbcConnTestStmt(); 121 } 122 126 public int getPoolInit() { 127 return poolInit; 128 } 129 133 public void setPoolInit(int val) { 134 poolInit = val; 135 } 136 137 141 public int getPoolMin() { 142 return poolMin; 143 } 144 148 public void setPoolMin(int val) { 149 poolMin = val; 150 } 151 152 156 public int getPoolMax() { 157 return poolMax; 158 } 159 163 public void setPoolMax(int val) { 164 poolMax = val; 165 } 166 167 171 public long getPoolMaxAge() { 172 return poolMaxAge; 173 } 174 178 public void setPoolMaxAge(long val) { 179 poolMaxAge = val; 180 } 181 182 186 public int getPoolMaxAgeMinutes() { 187 return poolMaxAgeMinutes; 188 } 189 193 public void setPoolMaxAgeMinutes(int val) { 194 poolMaxAgeMinutes = val; 195 } 196 197 201 public int getPoolMaxOpentime() { 202 return poolMaxOpentime; 203 } 204 208 public void setPoolMaxOpentime(int val) { 209 poolMaxOpentime = val; 210 } 211 212 216 public int getPoolMaxWaiters() { 217 return poolMaxWaiters; 218 } 219 223 public void setPoolMaxWaiters(int val) { 224 poolMaxWaiters = val; 225 } 226 227 231 public int getPoolMaxWaittime() { 232 return poolMaxWaittime; 233 } 234 238 public void setPoolMaxWaittime(int val) { 239 poolMaxWaittime = val; 240 } 241 242 246 public int getPoolSamplingPeriod() { 247 return poolSamplingPeriod; 248 } 249 253 public void setPoolSamplingPeriod(int val) { 254 poolSamplingPeriod = val; 255 } 256 257 261 public int getPstmtMax() { 262 return pstmtMax; 263 } 264 268 public void setPstmtMax(int val) { 269 pstmtMax = val; 270 } 271 272 276 public int getJdbcConnLevel() { 277 return jdbcConnLevel; 278 } 279 283 public void setJdbcConnLevel(int val) { 284 jdbcConnLevel = val; 285 } 286 287 291 public String getJdbcConnTestStmt() { 292 return jdbcConnTestStmt; 293 } 294 298 public void setJdbcConnTestStmt(String val) { 299 jdbcConnTestStmt = val; 300 } 301 302 306 public String toString() { 307 StringBuffer sb = new StringBuffer (); 308 sb.append("poolInit="); 309 sb.append(poolInit); 310 sb.append("\npoolMin="); 311 sb.append(poolMin); 312 sb.append("\npoolMax="); 313 sb.append(poolMax); 314 sb.append("\npoolMaxAge="); 315 sb.append(poolMaxAge); 316 sb.append("\npoolMaxAgeMinutes="); 317 sb.append(poolMaxAgeMinutes); 318 sb.append("\npoolMaxOpentime="); 319 sb.append(poolMaxOpentime); 320 sb.append("\npoolMaxWaiters="); 321 sb.append(poolMaxWaiters); 322 sb.append("\npoolMaxWaittime="); 323 sb.append(poolMaxWaittime); 324 sb.append("\npoolSamplingPeriod="); 325 sb.append(poolSamplingPeriod); 326 sb.append("\npstmtMax="); 327 sb.append(pstmtMax); 328 sb.append("\njdbcConnLevel="); 329 sb.append(jdbcConnLevel); 330 sb.append("\njdbcConnTestStmt="); 331 sb.append(jdbcConnTestStmt); 332 sb.append("\n"); 333 return sb.toString(); 334 } 335 } 336 | Popular Tags |