in src/main/java/org/apache/sling/jcr/contentloader/internal/BundleContentLoaderListener.java [168:216]
public synchronized void bundleChanged(BundleEvent event) {
//
// NOTE:
// This is synchronous - take care to not block the system !!
//
if (this.bundleContentLoader == null) {
return;
}
Session session = null;
final Bundle bundle = event.getBundle();
switch (event.getType()) {
case BundleEvent.RESOLVED:
// register content when the bundle content is available
// as node types are registered when the bundle is installed
// we can safely add the content at this point.
try {
session = this.getSession();
final boolean isUpdate;
isUpdate = this.updatedBundles.remove(bundle.getSymbolicName());
bundleContentLoader.registerBundle(session, bundle, isUpdate);
} catch (Exception t) {
log.error("bundleChanged: Problem loading initial content of bundle " + bundle.getSymbolicName()
+ " (" + bundle.getBundleId() + ")", t);
} finally {
this.ungetSession(session);
}
break;
case BundleEvent.UPDATED:
// we just add the symbolic name to the list of updated bundles
// we will use this info when the new start event is triggered
this.updatedBundles.add(bundle.getSymbolicName());
break;
case BundleEvent.UNINSTALLED:
try {
session = this.getSession();
bundleContentLoader.unregisterBundle(session, bundle);
} catch (Exception t) {
log.error("bundleChanged: Problem unloading initial content of bundle " + bundle.getSymbolicName()
+ " (" + bundle.getBundleId() + ")", t);
} finally {
this.ungetSession(session);
}
break;
default:
}
}