Add a isStopping() method on the extender
Fix comparison of system bundle (see ARIES-1031)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1509606 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/utils/src/main/java/org/apache/felix/utils/extender/AbstractExtender.java b/utils/src/main/java/org/apache/felix/utils/extender/AbstractExtender.java
index b63908b..2dbca76 100644
--- a/utils/src/main/java/org/apache/felix/utils/extender/AbstractExtender.java
+++ b/utils/src/main/java/org/apache/felix/utils/extender/AbstractExtender.java
@@ -99,6 +99,10 @@
this.preemptiveShutdown = preemptiveShutdown;
}
+ public boolean isStopping() {
+ return stopping;
+ }
+
public void start(BundleContext context) throws Exception {
this.context = context;
this.context.addBundleListener(this);
@@ -188,7 +192,7 @@
// 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) {
+ if (context.getBundle(0).equals(bundle) && bundle.getState() == Bundle.STOPPING) {
if (preemptiveShutdown) {
try {
stop(context);