01: /*
02: * BEGIN_HEADER - DO NOT EDIT
03: *
04: * The contents of this file are subject to the terms
05: * of the Common Development and Distribution License
06: * (the "License"). You may not use this file except
07: * in compliance with the License.
08: *
09: * You can obtain a copy of the license at
10: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
11: * See the License for the specific language governing
12: * permissions and limitations under the License.
13: *
14: * When distributing Covered Code, include this CDDL
15: * HEADER in each file and include the License file at
16: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
17: * If applicable add the following below this CDDL HEADER,
18: * with the fields enclosed by brackets "[]" replaced with
19: * your own identifying information: Portions Copyright
20: * [year] [name of copyright owner]
21: */
22:
23: /*
24: * @(#)JmxObjectNames.java
25: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
26: *
27: * END_HEADER - DO NOT EDIT
28: */
29: package com.sun.jbi.internal.security.mbeans;
30:
31: import javax.management.MalformedObjectNameException;
32: import javax.management.ObjectName;
33:
34: /**
35: * This class provides the JBI MBean ObjectNames.
36: * @author Sun Microsystems, Inc.
37: */
38: public final class JmxObjectNames {
39:
40: /** JMX Domain name for the jbi jmx server. */
41: public static final String JMX_JBI_DOMAIN = "com.sun.jbi";
42:
43: /** JBI MBean Object type. */
44: public static final String CONTROL_TYPE_KEY = "ControlType";
45:
46: /** JBI MBean Object type value. */
47: public static final String CONTROL_TYPE_VALUE = "Configuration";
48:
49: /** JBI MBean Object type. */
50: public static final String COMPONENT_TYPE_KEY = "ComponentType";
51: /** JBI MBean Object type value. */
52: public static final String SYSTEM_COMPONENT_TYPE_VALUE = "System";
53:
54: /** JBI Service Names. */
55: /** JBI MBean Object type name.*/
56: public static final String SERVICE_NAME_KEY = "ServiceName";
57: /** Service Names.*/
58: public static final String SECURITY_SERVICE = "SecurityService";
59:
60: /** jbi jmx domain. */
61: private static String sJbiJmxDomain = null;
62:
63: /** jbi admin object name. */
64: private static ObjectName sSecSvcConfigMBeanObjectName = null;
65:
66: /**
67: * gets the jmx domain name.
68: * @return domain name
69: */
70: public static String getJbiJmxDomain() {
71: if (sJbiJmxDomain == null) {
72: sJbiJmxDomain = System.getProperty("jbi.jmx.domain",
73: JMX_JBI_DOMAIN);
74: }
75: return sJbiJmxDomain;
76: }
77:
78: /**
79: * @return the ObjectName for the Security Service Configuration Mbean.
80: * @throws MalformedObjectNameException if the object name is not formatted
81: * according to jmx object name
82: */
83: public static ObjectName getSecurityServiceConfigMBeanObjectName()
84: throws MalformedObjectNameException {
85: if (sSecSvcConfigMBeanObjectName == null) {
86: String mbeanRegisteredName = getJbiJmxDomain() + ":"
87: + SERVICE_NAME_KEY + "=" + SECURITY_SERVICE + ","
88: + CONTROL_TYPE_KEY + "=" + CONTROL_TYPE_VALUE + ","
89: + COMPONENT_TYPE_KEY + "="
90: + SYSTEM_COMPONENT_TYPE_VALUE;
91: sSecSvcConfigMBeanObjectName = new ObjectName(
92: mbeanRegisteredName);
93: }
94: return sSecSvcConfigMBeanObjectName;
95: }
96:
97: }
|