app);
/**
* Install and start the new isolated bundle framework
*/
BundleFramework bundleFramework = _bundleFrameworkFactory.createBundleFramework(parentCtx,
config);
// We should now have a bundleFramework
if (bundleFramework != null) {
boolean frameworkStarted = false;
try {
// Start the empty framework bundle
bundleFramework.start();
frameworkStarted = true;
} catch (BundleException e) {
// This may fail if the framework bundle has exports but we will retry later
}
/**
* Install the bundles into the new framework
*/
try {
List<Bundle> installedBundles = new ArrayList<Bundle>();
BundleContext frameworkBundleContext = bundleFramework.getIsolatedBundleContext();
if (frameworkBundleContext != null) {
for (BundleSuggestion suggestion : bundlesToBeInstalled)
installedBundles.add(bundleFramework.install(suggestion, app));
}
// Finally, start the whole lot
if (!frameworkStarted)
bundleFramework.start();
} catch (BundleException be) {
bundleFramework.close();
throw be;
} catch (RuntimeException re) {
bundleFramework.close();
throw re;
}
}
LOGGER.debug(LOG_EXIT, "isolatedInstall", bundleFramework);