/** * Registers MBean with the server. * * @param <T> Type of mbean. * @param mbeanSrv MBean server. * @param igniteInstanceName Ignite instance name. * @param grp Name of the group. * @param name Name of mbean. * @param impl MBean implementation. * @param itf MBean interface. * @return JMX object name. * @throws MBeanRegistrationException if MBeans are disabled. * @throws JMException If MBean creation failed. */ public static <T> ObjectName registerMBean( MBeanServer mbeanSrv, @Nullable String igniteInstanceName, @Nullable String grp, String name, T impl, @Nullable Class<T> itf ) throws JMException { return registerMBean(mbeanSrv, makeMBeanName(igniteInstanceName, grp, name), impl, itf); }
/** Checks that a bean with the specified group and name is available and has the expected attribute */ private void checkBean(String grp, String name, String attributeName, Object expAttributeVal) throws Exception { ObjectName mBeanName = IgniteUtils.makeMBeanName(grid().name(), grp, name); Object attributeVal = grid().configuration().getMBeanServer().getAttribute(mBeanName, attributeName); assertEquals(expAttributeVal, attributeVal); } }
/** Checks that a bean with the specified group and name is available and has the expected attribute */ private void checkBean(String grp, String name, String attributeName, Object expAttributeVal) throws Exception { ObjectName mBeanName = IgniteUtils.makeMBeanName(grid().name(), grp, name); Object attributeVal = grid().configuration().getMBeanServer().getAttribute(mBeanName, attributeName); assertEquals(expAttributeVal, attributeVal); } }
/** * Registers MBean with the server. * * @param <T> Type of mbean. * @param mbeanSrv MBean server. * @param igniteInstanceName Ignite instance name. * @param grp Name of the group. * @param name Name of mbean. * @param impl MBean implementation. * @param itf MBean interface. * @return JMX object name. * @throws MBeanRegistrationException if MBeans are disabled. * @throws JMException If MBean creation failed. */ public static <T> ObjectName registerMBean( MBeanServer mbeanSrv, @Nullable String igniteInstanceName, @Nullable String grp, String name, T impl, @Nullable Class<T> itf ) throws JMException { return registerMBean(mbeanSrv, makeMBeanName(igniteInstanceName, grp, name), impl, itf); }