public ConnectionRegistry(Registry localRegistry, String hostname)
    {
        try {
            RMIConfigReader configReader = new RMIConfigReader();
            for(String server : configReader.get("servers").split(",")) {
                if(!server.equals(hostname)) {
                    connections.add(server);
                }
            }
        } catch (IOException e) {
            System.out.println("Failed to read the system config.");
            e.printStackTrace();
            System.exit(1);
        }

        this.localRegistry = localRegistry;
        registries.add(localRegistry);

        // Add the registries by hostname
        for(String connection : connections) {
            try {
                registries.add(LocateRegistry.getRegistry(connection));
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }