in src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java [253:288]
private void onChange(final ChangeStatus status, final ResourceChange change) throws LoginException {
log.debug("onChange: Detecting change {} for path '{}'", change.getType(), change.getPath());
// if this change was on languageRootPath level this might change basename and locale as well, therefore
// invalidate everything
if (languageRootPaths.contains(change.getPath())) {
log.debug(
"onChange: Detected change of cached language root '{}', removing all cached ResourceBundles",
change.getPath());
status.reloadAll = true;
} else {
for (final String root : languageRootPaths) {
if (change.getPath().startsWith(root)) {
// figure out which JcrResourceBundles from the cached ones is affected
for (JcrResourceBundle bundle : resourceBundleRegistry.getResourceBundles()) {
if (bundle.getLanguageRootPaths().contains(root)) {
// reload it
log.debug(
"onChange: Resource changes below '{}', reloading ResourceBundle '{}'",
root,
bundle);
status.reloadBundles.add(bundle);
}
}
}
}
// may be a completely new dictionary
if (status.resourceResolver == null) {
status.resourceResolver = createResourceResolver();
}
if (isDictionaryResource(status.resourceResolver, change)) {
status.reloadAll = true;
}
}
}