public void updateBundles(final DeploymentMetadata newMetadata,
final DeploymentMetadata oldMetadata, final AriesApplication app,
final BundleLocator locator, final Set<Bundle> bundles, final boolean startBundles)
throws UpdateException
{
UpdateStrategy strategy = null;
for (UpdateStrategy us : _updateStrategies) {
if (us.allowsUpdate(newMetadata, oldMetadata)) {
strategy = us;
break;
}
}
if (strategy == null)
throw new IllegalArgumentException(
"No UpdateStrategy supports the supplied DeploymentMetadata changes.");
synchronized (BundleFrameworkManager.SHARED_FRAMEWORK_LOCK) {
final BundleFramework appFwk = _frameworksByAppScope.get(app.getApplicationMetadata().getApplicationScope());
strategy.update(new UpdateStrategy.UpdateInfo() {
public void register(Bundle bundle)
{
bundles.add(bundle);
}