Results 1 to 3 of 3

Thread: Question on Changing the applicationEventMulticaster

  1. #1
    Join Date
    Feb 2008
    Posts
    16

    Default Question on Changing the applicationEventMulticaster

    I have the need to use a custom event multicaster in my application. I configured a new bean in the spring/extender application context.xml called applicationEventMulticaster that uses my custom class. This bean is only ever sent one event - when the spring extender bundle starts. My understanding is that it should be sent events whenever any spring powered bundle is started. Can someone explain why events for other bundles are not sent to this multicaster?

  2. #2
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

    did you use a fragment attached to the extender bundle to override the default event multicaster?

    If you did, I think you followed correctly what the reference documentation states, but unfortunately the reference documentation seems to be wrong. The bean to declare must be called "osgiApplicationEventMulticaster" and of type "org.springframework.osgi.context.event.OsgiBundle ApplicationContextEventMulticaster".

    By following the reference documentation, you override Spring's event multicaster, whose scope is limited to the owning application contex whereas the scope of Spring DM's event system is extended to all Spring-powered bundles. That's why you receive a event only once: when the application context of the extender starts.

    I'm not sure of all of this: it's based on the analysis of the source code. You should try my instructions before opening a JIRA to correct the documentation.

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    The documentation is indeed incorrect. Raised http://jira.springframework.org/browse/OSGI-772
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •