felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r758736 - /felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
Date Thu, 26 Mar 2009 16:47:11 GMT
Author: fmeschbe
Date: Thu Mar 26 16:47:01 2009
New Revision: 758736

URL: http://svn.apache.org/viewvc?rev=758736&view=rev
Log:
FELIX-979 Prevent bundle event handling after the bundle activator's stop method has terminated

Modified:
    felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java

Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java?rev=758736&r1=758735&r2=758736&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
(original)
+++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
Thu Mar 26 16:47:01 2009
@@ -142,6 +142,9 @@
 
     // the maximum log level when no LogService is available
     private int logLevel = CM_LOG_LEVEL_DEFAULT;
+    
+    // flag indicating whether BundleChange events should be consumed (FELIX-979)
+    private volatile boolean handleBundleEvents;
 
     public void start( BundleContext bundleContext )
     {
@@ -198,6 +201,7 @@
         }
 
         // register as bundle and service listener
+        handleBundleEvents = true;
         bundleContext.addBundleListener( this );
 
         // get all persistence managers to begin with
@@ -242,6 +246,7 @@
 
         // stop listening for events
         bundleContext.removeBundleListener( this );
+        handleBundleEvents = false;
 
         if ( configurationListenerTracker != null )
         {
@@ -489,7 +494,7 @@
 
     public void bundleChanged( BundleEvent event )
     {
-        if ( event.getType() == BundleEvent.UNINSTALLED )
+        if ( event.getType() == BundleEvent.UNINSTALLED && handleBundleEvents )
         {
             String location = event.getBundle().getLocation();
 



Mime
View raw message