• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

OSGi eventhandler implementation

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have created 2 OSGi bundles. One for publishing OSGi event (publisher bundle) and the other for receiving the OSGi event (subscriber bundle) using event admin service. I use the postEvent method from event admin service [org.osgi.service.event.EventAdmin.postEvent(Event event)]

In the bundle that receives the events, I have implemented EventHandler interface. handleEvent(Event event) method of this interface implementation just prints a message.

Everything works fine with these 2 bundles in OSGi container karaf. But when I modify the method handleEvent(Event event), by adding a Thread.sleep(5000); statement and restart the bundles, only the first event is properly handled. all other events are not reaching the subscriber bundle even though the publisher bundle generates events.

It is not clear to me, how to debug and what is causing this problem. Please let me know what would be the source of this problem.

Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic