if (debug)
log.debug("Scanning bundle " + bundleString + " for configurations...");
// initialize context
final DelegatedExecutionOsgiBundleApplicationContext localApplicationContext;
if (debug)
log.debug("Creating an application context for bundle " + bundleString);
try {
localApplicationContext = contextCreator.createApplicationContext(localBundleContext);
}
catch (Exception ex) {
log.error("Cannot create application context for bundle " + bundleString, ex);
return;
}
if (localApplicationContext == null) {
log.debug("No application context created for bundle " + bundleString);
return;
}
// create a dedicated hook for this application context
BeanFactoryPostProcessor processingHook = new OsgiBeanFactoryPostProcessorAdapter(localBundleContext,
postProcessors);
// add in the post processors
localApplicationContext.addBeanFactoryPostProcessor(processingHook);
// add the context to the tracker
managedContexts.put(bundleId, localApplicationContext);
localApplicationContext.setDelegatedEventMulticaster(multicaster);
// create refresh runnable
Runnable contextRefresh = new Runnable() {
public void run() {
localApplicationContext.refresh();
}
};
// executor used for creating the appCtx
// chosen based on the sync/async configuration