@Test public void testInit() throws Exception { taskManager.init(); ObjectName oName = new ObjectName(TaskManagerTest.class.getName() + ":type=" + TaskManager.class.getSimpleName()); assertTrue(ManagementFactory.getPlatformMBeanServer().isRegistered(oName)); }
public void init() { try { ObjectName oName = new ObjectName(this.name + ":type=" + TaskManager.class.getSimpleName()); ManagementFactory.getPlatformMBeanServer().registerMBean(this, oName); } catch (Exception e) { LOGGER.error("registerMBean_fail", "注册mbean出错", e); } }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { public void init() { try { ObjectName oName = new ObjectName(this.name + ":type=" + TaskManager.class.getSimpleName()); ManagementFactory.getPlatformMBeanServer().registerMBean(this, oName); } catch (Exception e) { LOGGER.error("registerMBean_fail", "注册mbean出错", e); } } }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { public void init() { try { ObjectName oName = new ObjectName(this.name + ":type=" + TaskManager.class.getSimpleName()); ManagementFactory.getPlatformMBeanServer().registerMBean(this, oName); } catch (Exception e) { LOGGER.error("registerMBean_fail", "注册mbean出错", e); } } TaskManager();  TaskManager(String name); }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { public void init() { try { ObjectName oName = new ObjectName(this.name + ":type=" + TaskManager.class.getSimpleName()); ManagementFactory.getPlatformMBeanServer().registerMBean(this, oName); } catch (Exception e) { LOGGER.error("registerMBean_fail", "注册mbean出错", e); } } TaskManager();  TaskManager(String name); void close(); void await(); boolean await(long timeout, TimeUnit unit); @Override void addTask(Object key, AbstractDelayTask newTask); @Override AbstractDelayTask removeTask(Object key); @Override String getTaskInfos(); void init(); }
TaskManager extends NacosDelayTaskExecuteEngine implements TaskManagerMBean { public void init() { try { ObjectName oName = new ObjectName(this.name + ":type=" + TaskManager.class.getSimpleName()); ManagementFactory.getPlatformMBeanServer().registerMBean(this, oName); } catch (Exception e) { LOGGER.error("registerMBean_fail", "注册mbean出错", e); } } TaskManager();  TaskManager(String name); void close(); void await(); boolean await(long timeout, TimeUnit unit); @Override void addTask(Object key, AbstractDelayTask newTask); @Override AbstractDelayTask removeTask(Object key); @Override String getTaskInfos(); void init();  }