1 /*
2 * $Id: JmxSupport.java 20321 2010-11-24 15:21:24Z dfeist $
3 * --------------------------------------------------------------------------------------
4 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.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 *
41 * Domain clash is resolved by appending a counter at the end.
42 * @return JMX domain name
43 */
44 String getDomainName(MuleContext context);
45
46 String getDomainName(MuleContext context, boolean resolveClash);
47
48 /**
49 * Create an object name. May cache the result.
50 * @param name jmx object name
51 * @return object name for MBeanServer consumption
52 * @throws MalformedObjectNameException for invalid names
53 */
54 ObjectName getObjectName(String name) throws MalformedObjectNameException;
55 }