1 /*
2 * $Id: JmxSupport.java 11234 2008-03-06 23:44:34Z tcarlson $
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 CPAL v1.0
7 * license, a copy of which has been included with this distribution in the
8 * LICENSE.txt file.
9 */
10
11 package org.mule.module.management.support;
12
13 import org.mule.api.MuleContext;
14
15 import javax.management.MalformedObjectNameException;
16 import javax.management.ObjectName;
17
18 /**
19 * Mule JMX supporting interface.
20 */
21 public interface JmxSupport
22 {
23 /** Default Mule domain prefix for all instances. */
24 String DEFAULT_JMX_DOMAIN_PREFIX = "Mule";
25
26 /**
27 * Uses JMX 1.2 and higher standard escape method and semantics.
28 * @param name value to escape for JMX compliance
29 * @return value valid for JMX
30 */
31 String escape(String name);
32
33 /**
34 * Calculates the domain name for the current Mule instance. The rules are:
35 * <ul>
36 * <li>Default Mule domain
37 * <li>If this server's instance ID is available, append "." (dot) and the ID
38 * <li>If no instance ID is available, don't append anything
39 * </ul>
40 * @return JMX domain name
41 */
42 String getDomainName(MuleContext context);
43
44 /**
45 * Create an object name. May cache the result.
46 * @param name jmx object name
47 * @return object name for MBeanServer consumption
48 * @throws MalformedObjectNameException for invalid names
49 */
50 ObjectName getObjectName(String name) throws MalformedObjectNameException;
51 }