You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by no...@apache.org on 2011/03/18 10:27:49 UTC

svn commit: r1082857 - /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java

Author: not
Date: Fri Mar 18 09:27:48 2011
New Revision: 1082857

URL: http://svn.apache.org/viewvc?rev=1082857&view=rev
Log:
ARIES-612 The blueprint container currently removes services, stops tracking references, and then destroys beans in reverse creation order (which I assume is the same as reverse dependency order). The problem is beans can depend on references and if they try to use references in destroy bad things happen. This commit moves the shutdown of references to after the beans are destroyed which should solve the problem.

Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1082857&r1=1082856&r2=1082857&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Fri Mar 18 09:27:48 2011
@@ -819,7 +819,6 @@ public class BlueprintContainerImpl impl
             handlerSet.destroy();
         }
         unregisterServices();
-        untrackServiceReferences();
 
         synchronized (running) {
             while (running.get()) {
@@ -833,6 +832,8 @@ public class BlueprintContainerImpl impl
 
         destroyComponents();
         
+        untrackServiceReferences();
+
         eventDispatcher.blueprintEvent(new BlueprintEvent(BlueprintEvent.DESTROYED, getBundleContext().getBundle(), getExtenderBundle()));
         LOGGER.debug("Blueprint container destroyed: {}", this.bundleContext);
     }