Repository: karaf
Updated Branches:
  refs/heads/master 8830fc973 -> cca039551


[KARAF-4737] Update bundle state according to start attribute only at feature 
installation


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/cca03955
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/cca03955
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/cca03955

Branch: refs/heads/master
Commit: cca039551911ce1c6408f5b34ae2ac5e7663fdc8
Parents: 8830fc9
Author: Jean-Baptiste Onofré <[email protected]>
Authored: Sun Nov 27 18:12:41 2016 +0100
Committer: Jean-Baptiste Onofré <[email protected]>
Committed: Sun Nov 27 18:14:07 2016 +0100

----------------------------------------------------------------------
 .../karaf/features/internal/service/Deployer.java     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/cca03955/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
----------------------------------------------------------------------
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
index e03e1b7..39a8224 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
@@ -465,10 +465,18 @@ public class Deployer {
             for (Map.Entry<String, Map<String, BundleInfo>> bis : 
resolver.getBundleInfos().entrySet()) {
                 bundleInfo = bis.getValue().get(getUri(resource));
             }
-            if (bundleInfo != null && bundleInfo.isStart()) {
-                states.put(resource, FeatureState.Started);
+            Bundle bundle = deployment.resToBnd.get(resource);
+            if (bundle == null) {
+                // bundle is not present, it's provided by feature
+                // we are using bundleInfo and start flag
+                if (bundleInfo != null && bundleInfo.isStart()) {
+                    states.put(resource, FeatureState.Started);
+                } else {
+                    states.put(resource, FeatureState.Resolved);
+                }
             } else {
-                states.put(resource, FeatureState.Resolved);
+                // if the bundle is already there, just ignore changing state 
by feature
+                states.remove(resource);
             }
         }
         // Only keep bundles resources

Reply via email to