[ 
https://issues.apache.org/jira/browse/ARIES-915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13998989#comment-13998989
 ] 

ASF GitHub Bot commented on ARIES-915:
--------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/aries/pull/8


> The CM module for managed-service-factory does not perform the update correct 
> with embedded managed-properties
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-915
>                 URL: https://issues.apache.org/jira/browse/ARIES-915
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.3
>            Reporter: Christoph Läubrich
>             Fix For: blueprint-cm-1.0.4
>
>         Attachments: ManagedServiceFactoryTest.java
>
>
> I'm using the following test case:
> {code:xml}<?xml version="1.0" encoding="UTF-8"?>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>     xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0";>
>     <cm:managed-service-factory id="testfactory"
>         factory-pid="testfactory" interface="test.FactoryTest"
>         auto-export="all-classes">
>         <cm:managed-component
>             class="test.FactoryTest"
>             init-method="init">
>             <cm:managed-properties persistent-id="" 
> update-strategy="component-managed" update-method="update"/>
>         </cm:managed-component>
>     </cm:managed-service-factory>
> </blueprint>{code}
> The testclass just print out to the log:{code:java}public class FactoryTest {
>     private static final Logger LOG = 
> LoggerFactory.getLogger(FactoryTest.class);
>     public FactoryTest() {
>         LOG.info("{}: FactoryTest.FactoryTest()", 
> System.identityHashCode(this));
>     }
>     public void init() {
>         // LOG.info("{}: FactoryTest.init()", System.identityHashCode(this));
>     }
>     public void update(Map<String, ?> props) {
>         LOG.info("{}: FactoryTest.update() props = {}", 
> System.identityHashCode(this), props);
>     }
> }{code}
> The logfile looks like this, I have reodereded the log output so each 
> instance is one block:{code}karaf@root> log:display
> 2012-09-04 09:36:30,660 | INFO  | rint Extender: 2 | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.FactoryTest()
> 2012-09-04 09:36:30,675 | INFO  | Thread-91        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo4, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-4.cfg,
>  service.pid=testfactory.8e97399a-940e-49c3-ae75-3e720951774a}
> 2012-09-04 09:36:30,677 | INFO  | Thread-92        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> 2012-09-04 09:36:30,688 | INFO  | Thread-93        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,697 | INFO  | Thread-94        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,699 | INFO  | Thread-96        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo1, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-1.cfg,
>  service.pid=testfactory.c5b988ec-8747-4354-84b4-5613a60b6ab1}
> 2012-09-04 09:36:30,703 | INFO  | Thread-95        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 30590872: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> 2012-09-04 09:36:30,703 | INFO  | Thread-95        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> 2012-09-04 09:36:30,668 | INFO  | rint Extender: 2 | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.FactoryTest()
> 2012-09-04 09:36:30,675 | INFO  | Thread-91        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo4, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-4.cfg,
>  service.pid=testfactory.8e97399a-940e-49c3-ae75-3e720951774a}
> 2012-09-04 09:36:30,677 | INFO  | Thread-92        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> 2012-09-04 09:36:30,688 | INFO  | Thread-93        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,697 | INFO  | Thread-94        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,701 | INFO  | Thread-96        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 7131715:  FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo1, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-1.cfg,
>  service.pid=testfactory.c5b988ec-8747-4354-84b4-5613a60b6ab1}
> 2012-09-04 09:36:30,671 | INFO  | rint Extender: 2 | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 21655743: FactoryTest.FactoryTest()
> 2012-09-04 09:36:30,699 | INFO  | Thread-96        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 21655743: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo1, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-1.cfg,
>  service.pid=testfactory.c5b988ec-8747-4354-84b4-5613a60b6ab1}
> 2012-09-04 09:36:30,687 | INFO  | Thread-93        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 21655743: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,697 | INFO  | Thread-94        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 21655743: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,703 | INFO  | Thread-95        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 21655743: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> 2012-09-04 09:36:30,679 | INFO  | rint Extender: 2 | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 20153007: FactoryTest.FactoryTest()
> 2012-09-04 09:36:30,688 | INFO  | Thread-93        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 20153007: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,698 | INFO  | Thread-94        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 20153007: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,701 | INFO  | Thread-96        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 20153007: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo1, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-1.cfg,
>  service.pid=testfactory.c5b988ec-8747-4354-84b4-5613a60b6ab1}
> 2012-09-04 09:36:30,704 | INFO  | Thread-95        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 20153007: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> 2012-09-04 09:36:30,681 | INFO  | Pid=testfactory) | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 17973749: FactoryTest.FactoryTest()
> 2012-09-04 09:36:30,698 | INFO  | Thread-94        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 17973749: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo2, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-2.cfg,
>  service.pid=testfactory.139e87cd-7f73-4dab-8289-af5e6be91ba5}
> 2012-09-04 09:36:30,701 | INFO  | Thread-96        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 17973749: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo1, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-1.cfg,
>  service.pid=testfactory.c5b988ec-8747-4354-84b4-5613a60b6ab1}
> 2012-09-04 09:36:30,703 | INFO  | Thread-95        | FactoryTest              
>    | 139 - test - 0.0.4.SNAPSHOT | 17973749: FactoryTest.update() props = 
> {service.factoryPid=testfactory, hallo=hallo3, 
> felix.fileinstall.filename=file:/tmp/apache-karaf-2.2.8/etc/testfactory-3.cfg,
>  service.pid=testfactory.3c44fb7d-6aa2-48e6-8050-1fac3c56f9b1}
> karaf@root>{code}
> The Problem is, that the update method is called multiple times (from 
> different threads) fore each instance, even if this configuration is not 
> related to this component!
> When enabling debug output for the cm component you see some messages like 
> this (it is the same for each distinct component): {code}CmManagedProperties  
>             | 9 - org.apache.aries.blueprint - 0.3.2 | Configuration updated 
> for bean=.component-1 / pid={code} It seems as if the (automatic generated?) 
> name for the bean should be component-1, component-2, component-3 or 
> something but is infact always component-1 so all existing components are 
> called.
> Beside this, the method 'protected void updated(String pid, Dictionary 
> props)' should be syncronized since it might be called from differen threads 
> (osgi/blueprint/internal...).
> I'm not sure if the 0.2 and 1.0 version is also affected by this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to