Author: jwross
Date: Thu Aug  9 12:44:28 2012
New Revision: 1371183

URL: http://svn.apache.org/viewvc?rev=1371183&view=rev
Log:
ARIES-902: Constituent relationships between subsystems and bundles are now 
retained or removed as appropriate when a subsystem is being uninstalled.

Modified:
    
aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java

Modified: 
aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java?rev=1371183&r1=1371182&r2=1371183&view=diff
==============================================================================
--- 
aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java
 (original)
+++ 
aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java
 Thu Aug  9 12:44:28 2012
@@ -26,9 +26,20 @@ public class BundleResourceUninstaller e
        
        public void uninstall() {
                removeReference();
-               removeConstituent();
+               // Always remove the bundle as a constituent of the subsystem 
being
+               // acted upon. The bundle may or may not actually be a 
constituent.
+               // This covers the case of unscoped subsystems with shared 
content
+               // where the resource may not be uninstallable.
+               removeConstituent(subsystem, resource);
                if (!isResourceUninstallable())
                        return;
+               // If the resource is uninstallable, remove it from the 
"provisioned to"
+               // subsystem in case it was a dependency. The "provisioned to" 
subsystem
+               // may be the same subsystem as the one being acted upon. This 
covers
+               // the case where a dependency of the subsystem being acted 
upon was 
+               // provisioned to another subsystem but is not content of the 
other
+               // subsystem.
+               removeConstituent(provisionTo, resource);
                if (isBundleUninstallable())
                        uninstallBundle();
        }


Reply via email to