1 28 29 30 package com.caucho.management.j2ee; 31 32 import com.caucho.sql.DBPool; 33 34 import javax.management.j2ee.statistics.JDBCConnectionPoolStats ; 35 import javax.management.j2ee.statistics.JDBCConnectionStats ; 36 import javax.management.j2ee.statistics.JDBCStats ; 37 38 41 public class JDBCResource 42 extends J2EEResource 43 implements StatisticsProvider<JDBCStats > 44 { 45 private final DBPool _dbPool; 46 47 public JDBCResource(DBPool dbPool) 48 { 49 _dbPool = dbPool; 50 } 51 52 protected String getName() 53 { 54 return _dbPool.getName(); 55 } 56 57 61 public String []getJdbcDataSources() 62 { 63 return queryObjectNames("j2eeType", "JDBCDataSource", 64 "JDBCResource", getName()); 65 } 66 67 public JDBCStats getStats() 68 { 69 return new JDBCStatsImpl(this); 70 } 71 72 class JDBCStatsImpl 73 extends StatsSupport 74 implements JDBCStats 75 { 76 public JDBCStatsImpl(J2EEManagedObject j2eeManagedObject) 77 { 78 super(j2eeManagedObject); 79 } 80 81 public JDBCConnectionStats []getConnections() 82 { 83 return new JDBCConnectionStats [0]; 85 } 86 87 public JDBCConnectionPoolStats []getConnectionPools() 88 { 89 return new JDBCConnectionPoolStats [0]; 91 } 92 } 93 } 94 | Popular Tags |