<< How marvelous! | Home | Google Apps Update: February 24 Outage Postmortem >>

Using EventAdmin for interprocess-communication

One of the tricks to really loosely coupling components in Eclipse is using an event broker to publish events and subscribe to events. You can roll your own which is easy enough (lets face it - it's a listener interface and a list keeping track of listeners) but it adds a constraint among plug-ins. Another solution is to use the OSGi EventAdmin service.

EventAdmin uses a concept of hierarchical topics much like a messaging system (JMS) and is available from all plugins. You simply add a dependency on org.eclipse.osgi.services and you're laughing.

This "Event Admin Service specification explained by Example" post has all the info you need to get started and if you ask nicely and there's enough interest I might even share my EventAdmin test plugin with you... :-)

Tags : , ,


Avatar: Bob Balfe

Re: Using EventAdmin for interprocess-communication

Nice Mikkel!

I actually have an Event Admin to Property Broker bridge.  Haven't heard a lot of requests for it but here is what it does in a nutshell:

You can add the bridge component to a page, define what properties it has and tie them to an Event Admin topic.  The component then generates output properties and Set actions for each of those properties.  This allows for a full circle communication between Event Admin topics and the declarative wiring of the property broker.
Avatar: Mikkel Heisterberg

Re: Using EventAdmin for interprocess-communication

That's sweet! Kind of what I was thinking of putting together as doing this declaratively e.g. using an extension point (if in code) is much better than having to do the low level stuff.
Avatar: Bob Balfe

Re: Using EventAdmin for interprocess-communication

Check it out, I just posted an entry.
Avatar: Mikkel Heisterberg

Re: Using EventAdmin for interprocess-communication

I couldn't use Bobs link so here it is to be sure people can navigate there for the videos: http://blog.balfes.net/index.php?entry=entry090225-064938

Add a comment Send a TrackBack