Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » RCP 3.x register alternate service implementation with locator
RCP 3.x register alternate service implementation with locator [message #1699824] Fri, 26 June 2015 21:19 Go to next message
Jim Klo is currently offline Jim KloFriend
Messages: 49
Registered: September 2012
Member
I have a need where I have a multiple versions of our RCP application, the base version is somewhat generic, and others contain domain specific enhancements to core functionality. In this case we have a parser which provided via a service. The domain specific parser, which is located in a different plug-in, but extends the base verion, implements the same service interface, but provides additional information in the parsed content.

The basic parser is registered declaratively within the plugin.xml. How should I register the enhanced version? It looks like I can register the the enhanced service version via the ServiceLocator which will overwrite any existing, but understanding that I can't exactly control the plug-in load order, how do I prevent the basic parser to now overwrite the enhanced parser? Do I need to alter the way it gets registered as well?

Thanks!
Re: RCP 3.x register alternate service implementation with locator [message #1699894 is a reply to message #1699824] Mon, 29 June 2015 01:36 Go to previous message
Eclipse UserFriend
Consider making your parsers available via OSGi Services instead. The spec provides for prioritizing services by using the "service.ranking" property. If unspecified, the service.ranking defaults to 0. The service.ranking is used by BundleContext#getServiceReference() to return the 'best' instance, and you can check it too.

Alternatively, specify your own ranking in your extension point schema to provide for other parser definitions to override your basic definition.

Brian.
Previous Topic:Showing Multiple Windows
Next Topic:Prevent from adding or Remove/Hide Property Pages in Settings
Goto Forum:
  


Current Time: Fri Apr 26 02:56:48 GMT 2024

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

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

Back to the top