1 /*
2 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
3 * The software in this package is published under the terms of the CPAL v1.0
4 * license, a copy of which has been included with this distribution in the
5 * LICENSE.txt file.
6 */
7 package org.mule.module.management.support;
8
9 import org.mule.api.MuleContext;
10
11 import javax.management.MalformedObjectNameException;
12 import javax.management.ObjectName;
13
14 /**
15 * Mule JMX supporting interface.
16 */
17 public interface JmxSupport
18 {
19 /** Default Mule domain prefix for all instances. */
20 String DEFAULT_JMX_DOMAIN_PREFIX = "Mule";
21
22 /**
23 * Uses JMX 1.2 and higher standard escape method and semantics.
24 * @param name value to escape for JMX compliance
25 * @return value valid for JMX
26 */
27 String escape(String name);
28
29 /**
30 * Calculates the domain name for the current Mule instance. The rules are:
31 * <ul>
32 * <li>Default Mule domain
33 * <li>If this server's instance ID is available, append "." (dot) and the ID
34 * <li>If no instance ID is available, don't append anything
35 * </ul>
36 *
37 * Domain clash is resolved by appending a counter at the end.
38 * @return JMX domain name
39 */
40 String getDomainName(MuleContext context);
41
42 String getDomainName(MuleContext context, boolean resolveClash);
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 }