示例#1
0
 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);
   }
 }
示例#2
0
 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);
   }
 }
示例#3
0
  /**
   * Init service
   *
   * @param context
   * @throws SystemException
   */
  public void init(ServiceContext context) throws SystemException {

    configDirectory = context.getServerConfigDirectory();
    System.out.println("ServerConfigFirectory:" + configDirectory.getAbsolutePath());
  }
示例#4
0
 public void init(ServiceContext con) throws SystemException {
   this.con = con;
   this.configDir = con.getServerConfigDirectory();
   setupServerConf();
   initJmx();
 }