aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARIES-915) The CM module for managed-service-factory does not perform the update correct with embedded managed-properties
Date Wed, 09 Apr 2014 21:05:17 GMT

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

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

GitHub user vanSabben opened a pull request:

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

    Fix managed service factory

    Multiple changes to fix the managed service factory in blueprint.
    
    There are multiple issues reported about this. For example: https://issues.apache.org/jira/browse/ARIES-915.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vanSabben/aries FixManagedServiceFactory

Alternatively you can review and apply these changes as the patch at:

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

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #8
    
----
commit bc7ce66cfa25953aad53b3fc36c06de496eb3b0e
Author: van Sabben <vansabben@users.noreply.github.com>
Date:   2014-04-09T19:17:56Z

    Test: Add tests with multiple services and update the services.

commit fdc0a6ce42d82d09a1012dfb10bb9e8cfe6a8756
Author: van Sabben <vansabben@users.noreply.github.com>
Date:   2014-04-09T19:53:11Z

    Fix: Update correct managed service in factory.

commit cb894ddf8c47890d18fc3aa29c15770378b72a83
Author: van Sabben <vansabben@users.noreply.github.com>
Date:   2014-04-09T19:55:28Z

    Test: Verify component managed update functionality.

commit 8f8bbff6370440974966b6b5cbdfc67ff11443d7
Author: van Sabben <vansabben@users.noreply.github.com>
Date:   2014-04-09T19:57:39Z

    Test: Verify factory functionality for a managed component.

commit b1efec1c339a5dca2b3e975d48295acf920811e1
Author: van Sabben <vansabben@users.noreply.github.com>
Date:   2014-04-09T19:58:32Z

    Fix: Factory functionality for a managed component.

----


> 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
>
> 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)

Mime
View raw message