Esempio n. 1
0
  public int init() {
    try {
      manager = new IndexManager();
      monitor = new Monitor(manager.getMetaManager().getLayoutManager());
      String ip =
          PublicParam.CONFIG.getStringValue(Configure.CONFIG_MANAGER, Configure.CONF_IP_ADDR, null);
      int port = PublicParam.CONFIG.getIntValue(Configure.CONFIG_MANAGER, Configure.CONF_PORT, 0);

      managerAddr = new Address(ip, port);
      String url = "rmi:/" + managerAddr.getAddr().toString() + "/manager";
      // echo
      System.out.println(url);
      LocateRegistry.createRegistry(port);
      Naming.rebind(url, manager);
      System.out.println("rmi:manager is ready!");
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    return GlobalMessage.ISS_SUCCESS;
  }
Esempio n. 2
0
 public static int inIPList(int localIP) {
   String ipList =
       PublicParam.CONFIG.getStringValue(
           Configure.CONFIG_MANAGER, Configure.CONF_IP_ADDR_LIST, null);
   // ProcessBuilder pb = new ProcessBuilder(command)
   // const char *ip_list = CONFIG.get_string_value(CONFIG_NAMESERVER, CONF_IP_ADDR_LIST);
   return 0;
 }