private void initJmx() { try { MBeanServer mbs = con.getMBeanServer(); ObjectName monitorName = new ObjectName("com.cubeia.firebase.service:type=ServerConfigProvider"); mbs.registerMBean(new ConfigurationDetails(this), monitorName); } catch (Exception e) { log.error("failed to start mbean", e); } }
private void destroyJmx() { try { MBeanServer mbs = con.getMBeanServer(); ObjectName monitorName = new ObjectName("com.cubeia.firebase.service:type=ServerConfigProvider"); if (mbs.isRegistered(monitorName)) { mbs.unregisterMBean(monitorName); } } catch (Exception e) { log.error("failed to stop mbean", e); } }
/** * Init service * * @param context * @throws SystemException */ public void init(ServiceContext context) throws SystemException { configDirectory = context.getServerConfigDirectory(); System.out.println("ServerConfigFirectory:" + configDirectory.getAbsolutePath()); }
public void init(ServiceContext con) throws SystemException { this.con = con; this.configDir = con.getServerConfigDirectory(); setupServerConf(); initJmx(); }