public class JmxUtil extends Object
Constructor and Description |
---|
JmxUtil() |
Modifier and Type | Method and Description |
---|---|
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(Object mbean,
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 |
static int |
unregisterMBeans(String filter,
MBeanServer mBeanServer)
Unregister all mbeans whose object names match a given filter.
|
public static MBeanServer lookupMBeanServer(GlobalConfiguration cfg)
MBeanServer
instance based on the
configuration parameters.cfg
- configuration instance indicating how to lookup
the MBeanServer
MBeanServer
public static String buildJmxDomain(GlobalConfiguration cfg, MBeanServer mBeanServer, String groupName)
cfg
- configuration instance containig rules on JMX domains allowedmBeanServer
- the MBeanServer
where to
check whether the JMX domain is allowed or not.groupName
- String containing the group name for the JMX MBeanpublic static void registerMBean(Object mbean, ObjectName objectName, MBeanServer mBeanServer) throws Exception
mbean
- Dynamic MBean to registerobjectName
- ObjectName
under which to register the MBean.mBeanServer
- MBeanServer
where to store the MBean.Exception
- If registration could not be completed.public static void unregisterMBean(ObjectName objectName, MBeanServer mBeanServer) throws Exception
ObjectName
objectName
- ObjectName
where the MBean is registeredmBeanServer
- MBeanServer
from which to unregister the MBean.Exception
- If unregistration could not be completed.public static int unregisterMBeans(String filter, MBeanServer mBeanServer)
filter
- ObjectName-style formatted filtermBeanServer
- mbean server from which to unregister mbeansCopyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.