in src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java [412:447]
public void handleNewView(final BaseTopologyView newView) {
logger.trace("handleNewView: start, newView={}", newView);
if (newView==null) {
throw new IllegalArgumentException("newView must not be null");
}
if (!newView.isCurrent()) {
logger.debug("handleNewView: newView is not current - calling handleChanging.");
handleChanging();
return;// false;
}
// paranoia-testing:
InstanceDescription localInstance = newView.getLocalInstance();
if (localInstance==null) {
throw new IllegalStateException("newView does not contain the local instance - hence cannot be current");
}
if (!localInstance.isLocal()) {
throw new IllegalStateException("newView's local instance is not isLocal - very unexpected - hence cannot be current");
}
// cancel any potentially ongoing sync
if (consistencyService != null) {
consistencyService.cancelSync();
}
logger.debug("handleNewView: newView is current, so trying with minEventDelayHandler...");
if (minEventDelayHandler!=null) {
if (minEventDelayHandler.handlesNewView(newView)) {
return;// true;
} else {
logger.debug("handleNewView: event delaying not applicable this time, invoking hanldeNewViewNonDelayed next.");
}
} else {
logger.debug("handleNewView: minEventDelayHandler not set, invoking hanldeNewViewNonDelayed...");
}
handleNewViewNonDelayed(newView);
}