OSGI service to find other services [message #1437224] |
Sat, 04 October 2014 03:07 |
John Bodkin Messages: 39 Registered: November 2011 |
Member |
|
|
My pure e4 rcp app has a MPart that contains a GLCanvas. That GLCanvas allows contributed layers. I want to create a LayerService that provides all of the contributed plugins that implement ILayer.
I created a plugin that creates a LayerServiceImpl through a ContextFunction. I also created another plugin that creates a GridLayerService and implements ILayer. However the GridLayerService can't get the LayerService injected for it to register itself as a contributed layer.
I can @Inject either service into the MPart that contains the GLCanvas but the GLCanvas should only know about the LayerService. It shouldn't know about the GridLayerService.
How do I create a service that can find other services that implement a particular interface (ILayer) and return a List of those layers so the GLCanvas can add them as layers?
I've been at this for a week.
[Updated on: Sat, 04 October 2014 03:08] Report message to a moderator
|
|
|
Re: OSGI service to find other services [message #1437801 is a reply to message #1437224] |
Sun, 05 October 2014 01:59 |
John Bodkin Messages: 39 Registered: November 2011 |
Member |
|
|
During the creation of the service that implements ILayer. In the context function compute method I get the ILayerService from the context and call the ILayerService register method. It seems to work. Perhaps because ILayer is defined in the same plugin that the ILayerService is in.
Feel free to correct me if this is a bad approach.
[Updated on: Sun, 05 October 2014 02:00] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05273 seconds