servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r701090 - /servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
Date Thu, 02 Oct 2008 11:46:53 GMT
Author: gnodet
Date: Thu Oct  2 04:46:52 2008
New Revision: 701090

URL: http://svn.apache.org/viewvc?rev=701090&view=rev
Log:
SMX4KNL-105: features are reinstalled on restart of servicemix

Modified:
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java?rev=701090&r1=701089&r2=701090&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
Thu Oct  2 04:46:52 2008
@@ -73,6 +73,7 @@
     private Map<String, Feature> features;
     private Map<String, Set<Long>> installed = new HashMap<String, Set<Long>>();
     private String boot;
+    private boolean bootFeaturesInstalled;
 
     public BundleContext getBundleContext() {
         return bundleContext;
@@ -267,7 +268,7 @@
             }
             saveState();
         }
-        if (boot != null) {
+        if (boot != null && !bootFeaturesInstalled) {
             new Thread() {
                 public void run() {
                     String[] list = boot.split(",");
@@ -280,6 +281,8 @@
                             }
                         }
                     }
+                    bootFeaturesInstalled = true;
+                    saveState();
                 }
             }.start();
         }
@@ -322,6 +325,7 @@
             Preferences prefs = preferences.getUserPreferences("FeaturesServiceState");
             saveSet(prefs.node("repositories"), repositories.keySet());
             saveMap(prefs.node("features"), installed);
+            prefs.putBoolean("bootFeaturesInstalled", bootFeaturesInstalled);
             prefs.flush();
         } catch (Exception e) {
             LOGGER.error("Error persisting FeaturesService state", e);
@@ -337,6 +341,7 @@
                     internalAddRepository(repo);
                 }
                 installed = loadMap(prefs.node("features"));
+                bootFeaturesInstalled = prefs.getBoolean("bootFeaturesInstalled", false);
                 return true;
             }
         } catch (Exception e) {



Mime
View raw message