Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x b7e837d94 -> b9f9e6c88


[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/b9f9e6c8
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/b9f9e6c8
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/b9f9e6c8

Branch: refs/heads/karaf-4.0.x
Commit: b9f9e6c88a81e37e425f460d70330912c917fb5b
Parents: b7e837d
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:12:41 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/b9f9e6c8/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 676ffa6..f55045e 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
@@ -443,10 +443,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