|
Re: Listing / choosing from multiple implementations of a service [message #1699961 is a reply to message #1699852] |
Mon, 29 June 2015 13:22 |
Eclipse User |
|
|
|
Niklas Henrich wrote on Sat, 27 June 2015 06:19My understanding is that via dependency injection of a service into my application, there are certain rules as to which implementation will be choosen.
Providing you've setup your DI IEclipseContext hierarchy to include the special OSGi Services-based context (which is the context setup used by E4 workbench apps), the service is chosen using OSGi's BundleContext#getServiceReference() and so governed by the service.ranking property to prioritize the available OSGi Services.
Quote:
But I want to get a list of all the possible implementations and let the user decide.
You can't have both. DI is a behind-the-scenes technology, and not intended to prompt the user for decision making. In this case, I think you'd need to deal with OSGi Services directly and present to the user. You could then explicitly set their selected service in your IEclipseContext hierarchy.
Brian.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02917 seconds