use of org.apache.ignite.internal.mxbean.IgniteStandardMXBean in project ignite by apache.
the class GridMBeanSelfTest method testEmptyNameMBeanInfo.
/**
* Tests correct MBean interface.
*
* @throws Exception Thrown if test fails.
*/
public void testEmptyNameMBeanInfo() throws Exception {
try {
StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), GridMBeanInterfaceEmptyName.class);
mbean.getMBeanInfo();
} catch (AssertionError ignored) {
return;
}
assert false;
}
use of org.apache.ignite.internal.mxbean.IgniteStandardMXBean in project ignite by apache.
the class IgniteUtils method registerMBean.
/**
* Registers MBean with the server.
*
* @param <T> Type of mbean.
* @param mbeanSrv MBean server.
* @param name MBean object name.
* @param impl MBean implementation.
* @param itf MBean interface.
* @return JMX object name.
* @throws MBeanRegistrationException if MBeans are disabled.
* @throws JMException If MBean creation failed.
* @throws IgniteException If MBean creation are not allowed.
*/
public static <T> ObjectName registerMBean(MBeanServer mbeanSrv, ObjectName name, T impl, Class<T> itf) throws JMException {
if (IGNITE_MBEANS_DISABLED)
throw new MBeanRegistrationException(new IgniteIllegalStateException("MBeans are disabled."));
assert mbeanSrv != null;
assert name != null;
assert itf != null;
DynamicMBean mbean = new IgniteStandardMXBean(impl, itf);
mbean.getMBeanInfo();
return mbeanSrv.registerMBean(mbean, name).getObjectName();
}
use of org.apache.ignite.internal.mxbean.IgniteStandardMXBean in project ignite by apache.
the class GridMBeanSelfTest method testMissedNameMBeanInfo.
/**
* Tests correct MBean interface.
*
* @throws Exception Thrown if test fails.
*/
public void testMissedNameMBeanInfo() throws Exception {
try {
StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), GridMBeanInterfaceBad.class);
mbean.getMBeanInfo();
} catch (AssertionError ignored) {
return;
}
assert false;
}
use of org.apache.ignite.internal.mxbean.IgniteStandardMXBean in project ignite by apache.
the class GridMBeanSelfTest method testMissedDescriptionMBeanInfo.
/**
* Tests correct MBean interface.
*
* @throws Exception Thrown if test fails.
*/
public void testMissedDescriptionMBeanInfo() throws Exception {
try {
StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), GridMBeanInterfaceBadAgain.class);
mbean.getMBeanInfo();
} catch (AssertionError ignored) {
return;
}
assert false;
}
Aggregations