This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes OSGi eventhandler implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "OSGi eventhandler implementation" Watch "OSGi eventhandler implementation" New topic
Author

OSGi eventhandler implementation

Anand Singhvi
Greenhorn

Joined: Aug 27, 2012
Posts: 1
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OSGi eventhandler implementation
 
Similar Threads
Plug in architecture using OSGi(Equinox)
osgi: question about bundle communication / design
Sweet spot of Spring-DM compared to other implementations?
synchronization in a loop
OSGi - Embedded Jetty Server - Servlet unable to get reference to Service Tracker