felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r805304 - /felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
Date Tue, 18 Aug 2009 07:52:13 GMT
Author: fmeschbe
Date: Tue Aug 18 07:52:13 2009
New Revision: 805304

URL: http://svn.apache.org/viewvc?rev=805304&view=rev
Log:
Ensure update/delete is sent regardless of whether the configuration
has to be supplied to any managed service [factory] or not

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=805304&r1=805303&r2=805304&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
Tue Aug 18 07:52:13 2009
@@ -999,7 +999,6 @@
             // check configuration and call plugins if existing
             if ( cfg != null )
             {
-
                 if ( cfg.isDelivered() )
                 {
                     log( LogService.LOG_DEBUG, "Configuration " + pid + " has already been
delivered", null );
@@ -1064,7 +1063,7 @@
                 if ( cfg != null )
                 {
                     cfg.setDelivered( true );
-                }
+	            }
             }
             catch ( ConfigurationException ce )
             {
@@ -1269,14 +1268,14 @@
 
         public void run()
         {
-            if ( config.isDelivered() )
-            {
-                log( LogService.LOG_DEBUG, "Configuration " + config.getPid() + " has already
been updated", null );
-                return;
-            }
-
             try
             {
+                if ( config.isDelivered() )
+                {
+                    log( LogService.LOG_DEBUG, "Configuration " + config.getPid() + " has
already been updated", null );
+                    return;
+                }
+
                 if ( config.getFactoryPid() == null )
                 {
                     final ServiceReference[] srList = bundleContext.getServiceReferences(
ManagedService.class
@@ -1402,8 +1401,12 @@
             {
                 log( LogService.LOG_ERROR, "Unexpected problem updating configuration", t
);
             }
-
-            fireConfigurationEvent( ConfigurationEvent.CM_UPDATED, config.getPid(), config.getFactoryPid()
);
+            finally
+            {
+                // the update event has to be sent regardless of whether the
+                // configuration was updated in a managed service or not
+                fireConfigurationEvent( ConfigurationEvent.CM_UPDATED, config.getPid(), config.getFactoryPid()
);
+            }
         }
 
         public String toString()
@@ -1430,14 +1433,14 @@
 
         public void run()
         {
-            if ( config.isDelivered() )
-            {
-                log( LogService.LOG_DEBUG, "Deletion of configuration " + pid + " has already
been delivered", null );
-                return;
-            }
-
             try
             {
+                if ( config.isDelivered() )
+                {
+                    log( LogService.LOG_DEBUG, "Deletion of configuration " + pid + " has
already been delivered", null );
+                    return;
+                }
+
                 if ( factoryPid == null )
                 {
                     ServiceReference[] srList = bundleContext.getServiceReferences( ManagedService.class.getName(),
"("
@@ -1499,8 +1502,12 @@
             {
                 log( LogService.LOG_ERROR, "Unexpected problem updating configuration", t
);
             }
-
-            fireConfigurationEvent( ConfigurationEvent.CM_DELETED, pid, factoryPid );
+            finally
+            {
+                // the delete event has to be sent regardless of whether the
+                // configuration was updated in a managed service or not
+                fireConfigurationEvent( ConfigurationEvent.CM_DELETED, pid, factoryPid );
+            }
         }
 
         public String toString()



Mime
View raw message