Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2010-03-18 21:14:48 +0000
committerThomas Watson2010-03-18 21:14:48 +0000
commit4f8e19c4a6295c4be5b3eb598e5220fac0f8f9bd (patch)
tree031c522dca1703278a891d21fc74a04fbd0aea93 /bundles/org.eclipse.osgi
parentd2e99ea826860c8301f1f800d9c5a6899a5edca1 (diff)
downloadrt.equinox.framework-4f8e19c4a6295c4be5b3eb598e5220fac0f8f9bd.tar.gz
rt.equinox.framework-4f8e19c4a6295c4be5b3eb598e5220fac0f8f9bd.tar.xz
rt.equinox.framework-4f8e19c4a6295c4be5b3eb598e5220fac0f8f9bd.zip
Bug 306181 - Cannot install new software after updating to last I-buildv20100322-1720
Diffstat (limited to 'bundles/org.eclipse.osgi')
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java7
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java31
2 files changed, 27 insertions, 11 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
index 66467e930..5921a07bf 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -195,6 +195,11 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
return ((state & (ACTIVE | STARTING)) != 0);
}
+ boolean isLazyStart() {
+ int status = bundledata.getStatus();
+ return (status & Constants.BUNDLE_ACTIVATION_POLICY) != 0 && (status & Constants.BUNDLE_LAZY_START) != 0;
+ }
+
/**
* Return true if the bundle is resolved.
*
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java
index a26ec7177..5ecc3e39a 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -243,6 +243,8 @@ public class StartLevelManager implements EventDispatcher, EventListener, StartL
Debug.println("sync - incrementing Startlevel from " + tempSL); //$NON-NLS-1$
}
tempSL++;
+ // Note that we must get a new list of installed bundles each time;
+ // this is because additional bundles could have been installed from the previous start-level
incFWSL(i + 1, getInstalledBundles(framework.bundles, false));
}
if (launching) {
@@ -458,7 +460,7 @@ public class StartLevelManager implements EventDispatcher, EventListener, StartL
// save the startlevel
saveActiveStartLevel(incToSL);
// resume all bundles at the startlevel
- resumeBundles(launchBundles);
+ resumeBundles(launchBundles, incToSL);
}
/**
@@ -536,22 +538,31 @@ public class StartLevelManager implements EventDispatcher, EventListener, StartL
}
/**
- * Resume all bundles in the launch list
+ * Resume all bundles in the launch list at the specified start-level
* @param launch a list of Bundle Objects to launch
+ * @param currentSL the current start-level that the bundles must meet to be resumed
*/
- private void resumeBundles(AbstractBundle[] launch) {
- /* Resume all bundles that were previously started and whose startlevel is <= the active startlevel */
- int fwsl = getStartLevel();
+ private void resumeBundles(AbstractBundle[] launch, int currentSL) {
+ // Resume all bundles that were previously started and whose startlevel is <= the active startlevel
+ // first resume the lazy activated bundles
+ resumeBundles(launch, true, currentSL);
+ // now resume all non lazy bundles
+ resumeBundles(launch, false, currentSL);
+ }
+
+ private void resumeBundles(AbstractBundle[] launch, boolean lazyOnly, int currentSL) {
for (int i = 0; i < launch.length && !framework.isForcedRestart(); i++) {
int bsl = launch[i].getStartLevel();
- if (bsl < fwsl) {
+ if (bsl < currentSL) {
// skip bundles who should have already been started
continue;
- } else if (bsl == fwsl) {
+ } else if (bsl == currentSL) {
if (Debug.DEBUG && Debug.DEBUG_STARTLEVEL) {
- Debug.println("SLL: Active sl = " + fwsl + "; Bundle " + launch[i].getBundleId() + " sl = " + bsl); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Debug.println("SLL: Active sl = " + currentSL + "; Bundle " + launch[i].getBundleId() + " sl = " + bsl); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- framework.resumeBundle(launch[i]);
+ boolean isLazyStart = launch[i].isLazyStart();
+ if (lazyOnly ? isLazyStart : !isLazyStart)
+ framework.resumeBundle(launch[i]);
} else {
// can stop resuming bundles since any remaining bundles have a greater startlevel than the framework active startlevel
break;

Back to the top