org.infinispan.jmx
Class JmxUtil

java.lang.Object
  extended by org.infinispan.jmx.JmxUtil

public class JmxUtil
extends Object

Class containing JMX related utility methods.

Since:
5.0
Author:
Galder ZamarreƱo

Constructor Summary
JmxUtil()
           
 
Method Summary
static String buildJmxDomain(GlobalConfiguration cfg, MBeanServer mBeanServer, String groupName)
          Build the JMX domain name.
static MBeanServer lookupMBeanServer(GlobalConfiguration cfg)
          Looks up the MBeanServer instance based on the configuration parameters.
static void registerMBean(ResourceDMBean dynamicMBean, ObjectName objectName, MBeanServer mBeanServer)
          Register the given dynamic JMX MBean.
static void unregisterMBean(ObjectName objectName, MBeanServer mBeanServer)
          Unregister the MBean located under the given ObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxUtil

public JmxUtil()
Method Detail

lookupMBeanServer

public static MBeanServer lookupMBeanServer(GlobalConfiguration cfg)
Looks up the MBeanServer instance based on the configuration parameters.

Parameters:
cfg - configuration instance indicating how to lookup the MBeanServer
Returns:
an instance of MBeanServer

buildJmxDomain

public static String buildJmxDomain(GlobalConfiguration cfg,
                                    MBeanServer mBeanServer,
                                    String groupName)
Build the JMX domain name.

Parameters:
cfg - configuration instance containig rules on JMX domains allowed
mBeanServer - the MBeanServer where to check whether the JMX domain is allowed or not.
groupName - String containing the group name for the JMX MBean
Returns:
A string that combines the allowed JMX domain and the group name

registerMBean

public static void registerMBean(ResourceDMBean dynamicMBean,
                                 ObjectName objectName,
                                 MBeanServer mBeanServer)
                          throws Exception
Register the given dynamic JMX MBean.

Parameters:
dynamicMBean - Dynamic MBean to register
objectName - ObjectName under which to register the MBean.
mBeanServer - MBeanServer where to store the MBean.
Throws:
Exception - If registration could not be completed.

unregisterMBean

public static void unregisterMBean(ObjectName objectName,
                                   MBeanServer mBeanServer)
                            throws Exception
Unregister the MBean located under the given ObjectName

Parameters:
objectName - ObjectName where the MBean is registered
mBeanServer - MBeanServer from which to unregister the MBean.
Throws:
Exception - If unregistration could not be completed.

-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.