1 4 5 package org.smartlib.pool.core; 6 7 import java.sql.*; 8 9 16 17 public class ConnectionLeakEventImpl implements ConnectionLeakEvent { 18 19 private Connection conn; 20 private String owner; 21 private long lastAccessedTime; 22 private long connectionObtainedTime; 23 private String poolName; 24 25 35 ConnectionLeakEventImpl(Connection conn, String owner, 36 long lastAccessedTime, long connectionObtainedTime, 37 String poolName) { 38 39 this.conn = conn; 40 this.owner= owner; 41 this.lastAccessedTime = lastAccessedTime; 42 this.connectionObtainedTime = connectionObtainedTime; 43 this.poolName = poolName; 44 45 } 46 47 51 public Connection getConnection() { 52 53 return conn; 54 55 } 56 57 60 public String getOwner() { 61 62 return owner; 63 64 } 65 66 69 public long getLastAccessedTime() { 70 71 return lastAccessedTime; 72 73 } 74 75 78 public long getConnectionObtainedTime() { 79 80 return connectionObtainedTime; 81 82 } 83 84 87 public String getPoolName() { 88 89 return poolName; 90 91 } 92 public String toString() { 94 95 StringBuffer sb = new StringBuffer (); 96 sb.append("\nConnectionLeakEvent--------->"); 97 sb.append("\n\tConnection: " + conn); 98 sb.append("\n\tOwner: " + owner); 99 sb.append("\n\tlastAccessedTime: " + lastAccessedTime ); 100 sb.append("\n\tconnectionObtainedTime : " + connectionObtainedTime ); 101 sb.append("\n\tpoolName : " + poolName ); 102 return (sb.toString()); 103 104 } 105 106 } 107 | Popular Tags |