public ArrayList<KeyValueServerInterface> getServersList() throws RemoteException { // ArrayList<KeyValueServerInterface> res = new ArrayList(); try { Registry registry = LocateRegistry.getRegistry(); String[] name = registry.list(); for (String str : name) { // if( str.equals(server_name) ) continue; KeyValueServerInterface obj = (KeyValueServerInterface) registry.lookup(str); res.add(obj); } } catch (Exception e) { System.out.println(e.getMessage()); } return res; }