1 22 package org.jboss.mx.util; 23 24 import java.util.Hashtable ; 25 26 import javax.management.MalformedObjectNameException ; 27 import javax.management.ObjectName ; 28 29 42 public class ObjectNameFactory 43 { 44 public static ObjectName create(String name) 45 { 46 try 47 { 48 return new ObjectName (name); 49 } 50 catch (MalformedObjectNameException e) 51 { 52 throw new Error ("Invalid ObjectName: " + name + "; " + e); 53 } 54 } 55 56 public static ObjectName create(String domain, String key, String value) 57 { 58 try 59 { 60 return new ObjectName (domain, key, value); 61 } 62 catch (MalformedObjectNameException e) 63 { 64 throw new Error ("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e); 65 } 66 } 67 68 public static ObjectName create(String domain, Hashtable table) 69 { 70 try 71 { 72 return new ObjectName (domain, table); 73 } 74 catch (MalformedObjectNameException e) 75 { 76 throw new Error ("Invalid ObjectName: " + domain + "," + table + "; " + e); 77 } 78 } 79 } 80 | Popular Tags |