try {
// Now process the changes ...
Set<NodeKey> locksToDelete = null;
for (Change change : changeSet) {
if (change instanceof NodeAdded) {
NodeAdded added = (NodeAdded)change;
Path addedPath = added.getPath();
if (locksPath.isAncestorOf(addedPath)) {
// Get the name of the node type ...
Map<Name, Property> props = added.getProperties();
NodeKey lockKey = added.getKey();
ModeShapeLock lock = new ModeShapeLock(lockKey, props);
locksByNodeKey.put(lock.getLockedNodeKey(), lock);
}
} else if (change instanceof NodeRemoved) {
NodeRemoved removed = (NodeRemoved)change;