Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Listener for bundle consuming services
Listener for bundle consuming services [message #981537] Mon, 12 November 2012 13:52 Go to next message
Mastah Naleh is currently offline Mastah Naleh
Messages: 32
Registered: April 2012
Member
I'm looking for something that is able to listen for event on consumption of services. I know that on gemnini blueprint you can give a listener to a reference declaration (via reference-listener), but I'm looking for something more global. I would like to avoid giving to each reference a listener and instead using something more global.
Anyone could give me some hint on the matter ? I've been looking for listener.
The only thing I managed to use, is a declaration of an EventHandler service. The problem is that EventHandler only listen for registering services, not the consumption of a service.

The idea behind that is to start a bundle that will log registering services (already done) and services been consumed (aka reference bind/unbind in gemini blueprint).

Thanks.

[Updated on: Mon, 12 November 2012 16:12]

Report message to a moderator

Re: Listener for bundle consuming services [message #982911 is a reply to message #981537] Tue, 13 November 2012 14:22 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
You could try using the OSGi service registry hooks. But whether you'd want to is another matter...
Re: Listener for bundle consuming services [message #986057 is a reply to message #982911] Sat, 17 November 2012 22:34 Go to previous messageGo to next message
Mastah Naleh is currently offline Mastah Naleh
Messages: 32
Registered: April 2012
Member
I did some try with the OSGi service registry.
I tried with BundleContext.addServiceListener(), but as EventHandlers, only the registration fire an event. It seem that there is no native event on consumption of services, but only on registration of services.

So, I assume that there is no way to listen for services been consumed by other bundle, expect be directly putting the ReferenceListener on a blueprint (gemini) service consumption configuration.

Off topic: Gemini Blueprint home page seem to be linking to wrong urls (lots of 404)
Re: Listener for bundle consuming services [message #986175 is a reply to message #986057] Mon, 19 November 2012 10:09 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Hi Mastah. I was referring to the service registry hooks rather than BundleContext.addServiceListener(). Please consult the OSGi core specification for details (chapter 55 of the OSGi Core 5.0 spec).

(Also the 404's seem to have gone away.)
Previous Topic:Enhancement propal for Integration tests
Next Topic:service lookup fails with plan based deployment
Goto Forum:
  


Current Time: Wed Sep 17 07:51:24 GMT 2014

Powered by FUDForum. Page generated in 0.04866 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software