remoteNodeMonitor.unscheduleNodeDeletion(newNeighbours);
Exception exception = null;
// Joins all the new neighbours
for (Iterator iter = newNeighbours.iterator(); iter.hasNext();) {
NodeInfo node = (NodeInfo) iter.next();
try {
findOrJoinRemoteNode(node);
} catch (NodeException e) {
exception = e;
break;
} catch (CommunicationException e) {
exception = e;
break;
}
}
// One new neighbour has not been joined successfully. Rolls-back.
if ( null != exception ) {
for (Iterator iter = newNeighbours.iterator(); iter.hasNext();) {
NodeInfo node = (NodeInfo) iter.next();
leaveRemoteNode(node);
}
throw new NodeException("Can not apply topology.", exception);
}
preparedTopology = aTopology;