You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Tomas Brimor (JIRA)" <ji...@apache.org> on 2013/03/28 15:54:14 UTC

[jira] [Created] (ARIES-1042) Blueprint XML with service element that uses auto-export and has nested registration-listener element will not have its listener registered

Tomas Brimor created ARIES-1042:
-----------------------------------

             Summary: Blueprint XML with service element that uses auto-export and has nested registration-listener element will not have its listener registered
                 Key: ARIES-1042
                 URL: https://issues.apache.org/jira/browse/ARIES-1042
             Project: Aries
          Issue Type: Bug
          Components: Blueprint
    Affects Versions: blueprint-core-1.1.0
            Reporter: Tomas Brimor


Changes to ServiceRecipe.java between org.apache.aries.blueprint.core-1.0.1 (Karaf 2.3.0) and org.apache.aries.blueprint.core-1.1.0 and (Karaf 2.3.1) breaks listener registration when the wrapping blueprint service element uses the auto-export attribute.

The problem *seems* to be how the "registered-flag" is handled. In version 1.0.1 the flag would be set on entering register/unregister while in 1.1.0 it is set last in each method.

This has the consequence that if the service tag uses the auto-export attribute the getClasses()->internalCreateService()->createService() method calls to create the service will check if the service is registered or not before registering listeners. As this was set on entering the register method earlier this would be true but in the new version it will not yet be set and therefore no listeners will be created.

Version 1.0.1:
{code}
register()
  set registered = true
  getClasses()
    createService()
      if registered == true
        registerListeners()
      if registered != true
        unregisterListeners()       
{code}

Version 1.1.0:
{code}
register()
  getClasses()
    createService()
      if registered == true
        registerListeners()
      if registered != true
        unregisterListeners()       
  set registered = true
{code}

Blueprint XML:
{code}
    <service id="myService" ref="myRef" auto-export="all-classes">
        <registration-listener registration-method="register" unregistration-method="unregister">
            <bean class="my.company.Listener">
                <argument ref="blueprintBundleContext"/>
            </bean>
        </registration-listener>
    </service>
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira