KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > management > support > JmxLegacySupport


1 /*
2  * $Id: JmxLegacySupport.java 4219 2006-12-09 10:15:14Z lajos $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10 package org.mule.management.support;
11
12 import javax.management.MalformedObjectNameException JavaDoc;
13 import javax.management.ObjectName JavaDoc;
14
15 /**
16  * Support class for JMX 1.1 based systems.
17  */

18 public class JmxLegacySupport extends AbstractJmxSupport
19 {
20
21     /**
22      * Uses simpler rules for escaping non-JMX compliant chars.
23      * Much of the work has already been performed in {@link org.mule.util.ObjectNameHelper}.
24      *
25      * @param name value to escape for JMX compliance
26      * @return value valid for JMX
27      */

28     public String JavaDoc escape(String JavaDoc name)
29     {
30         // do nothing at the moment, as ObjectNameHelper handles most of the conversion scenarios
31
// kept as a placeholder and no-op to keep newer JMX classes from kicking in.
32
return name;
33     }
34
35
36     /**
37      * For modern JMX implementation just delegate to a standard factory method.
38      *
39      * @param name object name
40      * @return ObjectName for MBeanServer
41      * @throws javax.management.MalformedObjectNameException
42      * for invalid names
43      */

44     public ObjectName JavaDoc getObjectName(String JavaDoc name) throws MalformedObjectNameException JavaDoc
45     {
46         return new ObjectName JavaDoc(name);
47     }
48 }
49
Popular Tags