01: package org.objectweb.celtix.bus.management.jmx;
02:
03: import java.util.logging.Level;
04: import java.util.logging.Logger;
05:
06: import javax.management.ObjectName;
07:
08: import org.objectweb.celtix.common.logging.LogUtils;
09:
10: public final class JMXUtils {
11:
12: public static final String DOMAIN_STRING = "org.objectweb.celtix.instrumentation";
13:
14: private static final Logger LOG = LogUtils
15: .getL7dLogger(JMXUtils.class);
16:
17: private JMXUtils() {
18: }
19:
20: /**
21: * Bus :
22: org.objectweb.celtix.instrumentation:type=Bus,name=celtix
23:
24: WorkQueue :
25: org.objectweb.celtix.instrumentation:type=Bus.WorkQueue,Bus=celtix,name=WorkQueue
26:
27: WSDLManager :
28: org.objectweb.celtix.instrumentation:type=Bus.WSDLManager,Bus=celtix,name=WSDLManager
29:
30:
31: Endpoint :
32: org.objectweb.celtix.instrumentation:type=Bus.Endpoint,Bus=celtix,
33: Bus.Service={http://objectweb.org/hello_world}SOAPService",Bus.Port=SoapPort,
34: name=Endpoint
35:
36: HTTPServerTransport:
37: org.objectweb.celtix.instrumentation:type=Bus.Service.Port.HTTPServerTransport,
38: Bus=celtix,Bus.Service={http://objectweb.org/hello_world}SOAPService",Bus.Port=SoapPort,
39: name=HTTPServerTransport"
40:
41: JMSServerTransport:
42: org.objectweb.celtix.instrumentation:type=Bus.Service.Port.JMSServerTransport,
43: Bus=celtix,Bus.Service={http://objectweb.org/hello_world}SOAPService",Bus.Port=SoapPort,
44: name=JMSServerTransport"
45: ...
46:
47: */
48: // org.objectweb.celtix:type=Componnet,name=QuotedQName,bus=busIdentifier
49: public static ObjectName getObjectName(String type, String name,
50: String busID) {
51: String objectName = "";
52: if (type.compareTo("Bus") == 0) {
53: objectName = ":type=" + type + ",name=" + busID;
54: } else {
55: objectName = ":type=" + type + ",Bus=" + busID + name;
56: }
57: try {
58: return new ObjectName(DOMAIN_STRING + objectName);
59: } catch (Exception ex) {
60: LOG.log(Level.SEVERE, "OBJECT_NAME_FALUE_MSG",
61: new Object[] { name, ex });
62: }
63: return null;
64: }
65:
66: }
|