Class MBeanUtils
- java.lang.Object
-
- org.opendaylight.infrautils.diagstatus.MBeanUtils
-
public final class MBeanUtils extends Object
MBeanUtils is a utility that can be used for registering a new MBean or accessing any MBean service.- Author:
- Faseela K - initial author, Michael Vorburger.ch - exception handling improvements and introduction of strongly typed getMBean()
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
getMBean(String jmxName, Class<T> klass)
static @Nullable Object
getMBeanAttribute(String objName, String attribute)
static MBeanServer
registerServerMBean(Object mxBeanImplementor, String objNameStr)
static MBeanServer
registerServerMBean(Object mxBeanImplementor, ObjectName objName)
static void
unregisterServerMBean(Object mxBeanImplementor, String objNameStr)
static void
unregisterServerMBean(Object mxBeanImplementor, ObjectName objName)
-
-
-
Method Detail
-
registerServerMBean
public static MBeanServer registerServerMBean(Object mxBeanImplementor, ObjectName objName) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
-
registerServerMBean
public static MBeanServer registerServerMBean(Object mxBeanImplementor, String objNameStr) throws JMException
- Throws:
JMException
-
unregisterServerMBean
public static void unregisterServerMBean(Object mxBeanImplementor, ObjectName objName) throws InstanceNotFoundException, MBeanRegistrationException
-
unregisterServerMBean
public static void unregisterServerMBean(Object mxBeanImplementor, String objNameStr) throws MalformedObjectNameException, InstanceNotFoundException, MBeanRegistrationException
-
getMBeanAttribute
public static @Nullable Object getMBeanAttribute(String objName, String attribute) throws JMException
- Throws:
JMException
-
getMBean
public static <T> T getMBean(String jmxName, Class<T> klass) throws MalformedObjectNameException
- Throws:
MalformedObjectNameException
-
-