You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2011/04/21 09:30:28 UTC

svn commit: r1095614 - /karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java

Author: gnodet
Date: Thu Apr 21 07:30:28 2011
New Revision: 1095614

URL: http://svn.apache.org/viewvc?rev=1095614&view=rev
Log:
[KARAF-534] The default bundle start level is 1 after a restart

Modified:
    karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java

Modified: karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java
URL: http://svn.apache.org/viewvc/karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java?rev=1095614&r1=1095613&r2=1095614&view=diff
==============================================================================
--- karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java (original)
+++ karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java Thu Apr 21 07:30:28 2011
@@ -263,11 +263,9 @@ public class Main {
         FrameworkFactory factory = (FrameworkFactory) classLoader.loadClass(factoryClass).newInstance();
         framework = factory.newFramework(new StringMap(configProps, false));
         framework.init();
-        // If we have a clean state, install everything
-        if (framework.getBundleContext().getBundles().length == 1) {
-            loadStartupProperties(configProps);
-            processAutoProperties(framework.getBundleContext());
-        }
+        // Process properties
+        loadStartupProperties(configProps);
+        processAutoProperties(framework.getBundleContext());
         framework.start();
         // Start lock monitor
         new Thread() {
@@ -558,21 +556,24 @@ public class Main {
         }
         sl.setInitialBundleStartLevel(ibsl);
 
-        // The auto-install property specifies a space-delimited list of
-        // bundle URLs to be automatically installed into each new profile;
-        // the start level to which the bundles are assigned is specified by
-        // appending a ".n" to the auto-install property name, where "n" is
-        // the desired start level for the list of bundles.
-        autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUrls, false);
-
-        // The auto-start property specifies a space-delimited list of
-        // bundle URLs to be automatically installed and started into each
-        // new profile; the start level to which the bundles are assigned
-        // is specified by appending a ".n" to the auto-start property name,
-        // where "n" is the desired start level for the list of bundles.
-        // The following code starts bundles in one pass, installing bundles
-        // for a given level, then starting them, then moving to the next level.
-        autoInstall(PROPERTY_AUTO_START, context, sl, convertToMavenUrls, true);
+        // If we have a clean state, install everything
+        if (framework.getBundleContext().getBundles().length == 1) {
+            // The auto-install property specifies a space-delimited list of
+            // bundle URLs to be automatically installed into each new profile;
+            // the start level to which the bundles are assigned is specified by
+            // appending a ".n" to the auto-install property name, where "n" is
+            // the desired start level for the list of bundles.
+            autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUrls, false);
+
+            // The auto-start property specifies a space-delimited list of
+            // bundle URLs to be automatically installed and started into each
+            // new profile; the start level to which the bundles are assigned
+            // is specified by appending a ".n" to the auto-start property name,
+            // where "n" is the desired start level for the list of bundles.
+            // The following code starts bundles in one pass, installing bundles
+            // for a given level, then starting them, then moving to the next level.
+            autoInstall(PROPERTY_AUTO_START, context, sl, convertToMavenUrls, true);
+        }
     }
 
     private List<Bundle> autoInstall(String propertyPrefix, BundleContext context, StartLevel sl, boolean convertToMavenUrls, boolean start) {