aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1594997 - in /aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm: CmManagedProperties.java CmManagedServiceFactory.java
Date Thu, 15 May 2014 18:13:36 GMT
Author: dkulp
Date: Thu May 15 18:13:36 2014
New Revision: 1594997

URL: http://svn.apache.org/r1594997
Log:
Fix: Update correct managed service in factory.

Modified:
    aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java
    aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java

Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java?rev=1594997&r1=1594996&r2=1594997&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java
(original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java
Thu May 15 18:13:36 2014
@@ -152,7 +152,14 @@ public class CmManagedProperties impleme
         LOGGER.debug("Configuration updated for bean={} / pid={}", beanName, persistentId);
         synchronized (lock) {
             properties = props;
-            for (Object bean : beans) {
+        }
+    }
+
+    public void updated(Object bean, final Dictionary props) {
+        LOGGER.debug("Configuration updated for bean={} / pid={}", beanName, persistentId);
+        synchronized (lock) {
+            properties = props;
+            if (bean != null) {
                 inject(bean, false);
             }
         }

Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1594997&r1=1594996&r2=1594997&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
(original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
Thu May 15 18:13:36 2014
@@ -134,7 +134,7 @@ public class CmManagedServiceFactory ext
             while (!properties.isEmpty()) {
                 properties.remove(properties.keys().nextElement());
             }
-        } else  {
+        } else {
             if (!cm.getUpdate()) {
                 if (update) {
                     while (!properties.isEmpty()) {
@@ -157,10 +157,10 @@ public class CmManagedServiceFactory ext
         properties.put(Constants.SERVICE_PID, pid);
     }
 
-    private void updateComponentProperties(Dictionary props) {
+    private void updateComponentProperties(Object bean, Dictionary props) {
         CmManagedProperties cm = findBeanProcessor();
         if (cm != null) {
-            cm.updated(props);
+            cm.updated(bean, props);
         }
     }
 
@@ -200,14 +200,14 @@ public class CmManagedServiceFactory ext
     }
 
     protected Object doCreate(Dictionary properties) throws Exception {
-        updateComponentProperties(copy(properties));
+        updateComponentProperties(null, copy(properties));
         Object component = blueprintContainer.getComponentInstance(managedComponentName);
         getRegistrationProperties(properties, false);
         return component;
     }
 
     protected Object doUpdate(Object service, Dictionary properties) throws Exception {
-        updateComponentProperties(copy(properties));
+        updateComponentProperties(service, copy(properties));
         getRegistrationProperties(properties, true);
         return service;
     }



Mime
View raw message