/** * Get the Jolokia MBeanServer. This call is delegated to the corresponding * static utility method and will register a new MBeanServer if not already * present * * @return the Jolokia MBeanServer */ public MBeanServer getObject() { return JolokiaMBeanServerUtil.getJolokiaMBeanServer(); }
/** * Unregister an MBean at the JolokiaMBeanServer. This call is directly delegated * to the JolokiaMBeanServer * * @param name objectname of the MBean to unregister * @throws InstanceNotFoundException * @throws MBeanRegistrationException */ public static void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException { getJolokiaMBeanServer().unregisterMBean(name); }
/** * Register an MBean at the JolokiaMBeanServer. This call is directly delegated * to the JolokiaMBeanServer * * @param object object to register * @param name object name under which to register the MBean * @return the object instance created * @throws InstanceAlreadyExistsException * @throws MBeanRegistrationException * @throws NotCompliantMBeanException */ public static ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { return getJolokiaMBeanServer().registerMBean(object, name); }
public MBeanServer getJolokiaMBeanServer() { try { if (this.getClass("org.jolokia.jmx.JolokiaMBeanServerUtil") != null || Class.forName("org.jolokia.jmx.JolokiaMBeanServerUtil") != null) { return JolokiaMBeanServerUtil.getJolokiaMBeanServer(); } } catch (RuntimeException e) { System.out.println("No JolokiaServer found: " + e); e.printStackTrace(); return null; } catch (ClassNotFoundException e) { } System.out.println("No JolokiaServer found, ignoring certain tests ..."); return null; } }
/** * Get the Jolokia MBeanServer. This call is delegated to the corresponding * static utility method and will register a new MBeanServer if not already * present * * @return the Jolokia MBeanServer */ public MBeanServer getObject() { return JolokiaMBeanServerUtil.getJolokiaMBeanServer(); }
/** * Unregister an MBean at the JolokiaMBeanServer. This call is directly delegated * to the JolokiaMBeanServer * * @param name objectname of the MBean to unregister * @throws InstanceNotFoundException * @throws MBeanRegistrationException */ public static void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException { getJolokiaMBeanServer().unregisterMBean(name); }
/** * Register an MBean at the JolokiaMBeanServer. This call is directly delegated * to the JolokiaMBeanServer * * @param object object to register * @param name object name under which to register the MBean * @return the object instance created * @throws InstanceAlreadyExistsException * @throws MBeanRegistrationException * @throws NotCompliantMBeanException */ public static ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { return getJolokiaMBeanServer().registerMBean(object, name); }
private synchronized MBeanServer getMBeanServer() { if (mBeanServer == null) { // return platform mbean server if the option is specified. if (configuration.isUsePlatformMBeanServer()) { mBeanServer = ManagementFactory.getPlatformMBeanServer(); } else { mBeanServer = JolokiaMBeanServerUtil.getJolokiaMBeanServer(); } } return mBeanServer; } }