}
}
public void register(String serviceKey, InetSocketAddress addr) {
try {
ConfigPath parent = endpointsRoot.child(serviceKey);
EndpointData record = new EndpointData();
record.address = InetSocketAddresses.toString(addr);
String machineKey = MachineInfo.INSTANCE.getMachineKey();
ConfigPath node = parent.child(machineKey);
String json = JsonCodec.gson.toJson(record);
node.write(json);
} catch (IOException e) {
// TODO: Retry??
throw new IllegalArgumentException("Error writing endpoint entry", e);
}
}