1 package org.objectweb.celtix.bus.management.jmx; 2 3 import java.util.logging.Level ; 4 import java.util.logging.Logger ; 5 6 import javax.management.ObjectName ; 7 8 import org.objectweb.celtix.common.logging.LogUtils; 9 10 11 public final class JMXUtils { 12 13 public static final String DOMAIN_STRING = "org.objectweb.celtix.instrumentation"; 14 15 private static final Logger LOG = LogUtils.getL7dLogger(JMXUtils.class); 16 private JMXUtils() { 17 } 18 19 47 public static ObjectName getObjectName(String type, String name, String busID) { 49 String objectName = ""; 50 if (type.compareTo("Bus") == 0) { 51 objectName = ":type=" + type + ",name=" + busID; 52 } else { 53 objectName = ":type=" + type + ",Bus=" + busID + name; 54 } 55 try { 56 return new ObjectName (DOMAIN_STRING + objectName); 57 } catch (Exception ex) { 58 LOG.log(Level.SEVERE, "OBJECT_NAME_FALUE_MSG", new Object []{name, ex}); 59 } 60 return null; 61 } 62 63 64 65 } 66 | Popular Tags |