Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » OSGI service to find other services(a custom service that provides other services)
OSGI service to find other services [message #1437224] Sat, 04 October 2014 03:07 Go to next message
John Bodkin is currently offline John BodkinFriend
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 Go to previous message
John Bodkin is currently offline John BodkinFriend
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

Previous Topic:Switching between perspectives in an e4 RCP application
Next Topic:Create Miultiple Set of Boxes
Goto Forum:
  


Current Time: Thu Apr 25 04:45:39 GMT 2024

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

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

Back to the top