* https://bugs.eclipse.org/bugs/show_bug.cgi?id=379384
*
* UPDATE: This issue still seems to occur with Blueprint 1.0.2.RELEASE. Since Dynamic Extensions de-emphasizes
* the direct use of OSGi anyway, Blueprint configuration will definitely not be supported.
*/
final ApplicationContextConfiguration config = new ApplicationContextConfiguration(bundle);
String[] configurationLocations = null;
if (config.isSpringPoweredBundle()) {
configurationLocations = config.getConfigurationLocations();
}
if ((configurationLocations == null || configurationLocations.length == 0)
&& isAlfrescoDynamicExtension(bundle) == false) {
return null;
}
if (isAlfrescoDynamicExtension(bundle)) {
uninstallBundlesWithDuplicateSymbolicName(bundleContext);
}
final DynamicExtensionsApplicationContext applicationContext = new DynamicExtensionsApplicationContext(
configurationLocations, getHostApplicationContext(bundleContext));
applicationContext.setBundleContext(bundleContext);
final DefaultContextClassLoaderProvider contextClassLoaderProvider = new DefaultContextClassLoaderProvider();
contextClassLoaderProvider.setBeanClassLoader(ApplicationContext.class.getClassLoader());
applicationContext.setContextClassLoaderProvider(contextClassLoaderProvider);
applicationContext.setPublishContextAsService(config.isPublishContextAsService());
return applicationContext;
}