You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by gn...@apache.org on 2013/01/18 09:31:42 UTC

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

Author: gnodet
Date: Fri Jan 18 08:31:42 2013
New Revision: 1435050

URL: http://svn.apache.org/viewvc?rev=1435050&view=rev
Log:
[ARIES-1004] When the framework is being shut down, blueprint bundles are not shut down orderly

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

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1435050&r1=1435049&r2=1435050&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Fri Jan 18 08:31:42 2013
@@ -190,6 +190,16 @@ public class BlueprintExtender implement
     }
 
     public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
+        // If the bundle being stopped is the system bundle,
+        // do an orderly shutdown of all blueprint contexts now
+        // so that service usage can actually be useful
+        if (bundle.getBundleId() == 0 && bundle.getState() == Bundle.STOPPING) {
+            String val = context.getProperty("org.apache.aries.blueprint.preemptiveShutdown");
+            if (val == null || Boolean.parseBoolean(val)) {
+                stop(context);
+                return;
+            }
+        }
         if (bundle.getState() != Bundle.ACTIVE && bundle.getState() != Bundle.STARTING) {
             // The bundle is not in STARTING or ACTIVE state anymore
             // so destroy the context