in discovery/zookeeper/src/main/java/org/apache/aries/rsa/discovery/zookeeper/client/ZookeeperEndpointListener.java [91:112]
private void watchRecursive(String path) {
LOG.info("Watching {}", path);
try {
EndpointDescription endpoint = read(path);
if (endpoint != null) {
onChanged(path, endpoint);
}
List<String> children = zk.getChildren(path, this::process);
if (children == null) {
return;
}
for (String child : children) {
String childPath = (path.endsWith("/") ? path : path + "/") + child;
watchRecursive(childPath);
}
} catch (NoNodeException | SessionExpiredException | ConnectionLossException e) {
// NoNodeException happens when a node was removed
LOG.debug(e.getMessage(), e);
} catch (Exception e) {
LOG.info(e.getMessage(), e);
}
}