1 28 29 30 package com.caucho.management.j2ee; 31 32 import com.caucho.sql.DriverConfig; 33 34 import javax.management.MalformedObjectNameException ; 35 import javax.management.ObjectName ; 36 import java.util.Hashtable ; 37 38 41 public class JDBCDriver extends J2EEManagedObject { 42 private static int _g_id; 43 44 private final DriverConfig _driverConfig; 45 46 public JDBCDriver(DriverConfig driverConfig) 47 { 48 _driverConfig = driverConfig; 49 } 50 51 protected String getName() 52 { 53 return _driverConfig.getURL(); 54 } 55 56 protected ObjectName createObjectName(Hashtable <String , String > properties) 57 throws MalformedObjectNameException 58 { 59 String name = _driverConfig.getDBPool().getName(); 60 61 if (name != null) 62 properties.put("JDBCDataSource", quote(name)); 63 else 64 properties.put("JDBCDataSource", quote("tmp-" + _g_id++)); 65 66 return super.createObjectName(properties); 67 } 68 69 } 70 | Popular Tags |