running = Thread.currentThread();
}
}
try {
ChangeSet changes = changeListener.getChanges();
while (!stopping && changes != null) {
EventFilter filter = filterRef.get();
if (!(filter.excludeLocal() && changes.isLocal(contentSession))) {
String path = namePathMapper.getOakPath(filter.getPath());
ImmutableTree beforeTree = getTree(changes.getBeforeState(), path);
ImmutableTree afterTree = getTree(changes.getAfterState(), path);
EventGeneratingNodeStateDiff diff = new EventGeneratingNodeStateDiff(changes, beforeTree, afterTree);
SecureNodeStateDiff.compare(VisibleDiff.wrap(diff), beforeTree, afterTree);
if (!stopping) {
diff.sendEvents();
}