1 2 12 package com.versant.core.jdbc.logging; 13 14 17 public class JdbcPoolEvent extends JdbcLogEvent { 18 19 private int connectionID; 20 private int maxActive; 21 private int active; 22 private int maxIdle; 23 private int idle; 24 private boolean highPriority; 25 private boolean autoCommit; 26 27 public JdbcPoolEvent(long txId, int type, boolean highPriority) { 28 super(txId, type, null); 29 this.highPriority = highPriority; 30 } 31 32 public void update(int maxActive, int active, int maxIdle, int idle) { 33 updateTotalMs(); 34 this.maxActive = maxActive; 35 this.active = active; 36 this.maxIdle = maxIdle; 37 this.idle = idle; 38 } 39 40 public String getDescription() { 41 if (maxActive == 0) return "Busy ..."; 42 if (descr == null) { 43 descr = "active " + active + "/" + maxActive + 44 " idle " + idle + "/" + maxIdle + (autoCommit ? " AC" : ""); 45 } 46 return descr; 47 } 48 49 public boolean isAutoCommit() { 50 return autoCommit; 51 } 52 53 public void setAutoCommit(boolean autoCommit) { 54 this.autoCommit = autoCommit; 55 } 56 57 public void setConnectionID(int connectionID) { 58 this.connectionID = connectionID; 59 } 60 61 public int getConnectionID() { 62 return connectionID; 63 } 64 65 public int getResourceID() { 66 return connectionID; 67 } 68 69 public boolean isHighPriority() { 70 return highPriority; 71 } 72 73 public int getMaxActive() { 74 return maxActive; 75 } 76 77 public int getActive() { 78 return active; 79 } 80 81 public int getMaxIdle() { 82 return maxIdle; 83 } 84 85 public int getIdle() { 86 return idle; 87 } 88 89 } 90 | Popular Tags |