How to consume/reference context functions [message #1443850] |
Mon, 13 October 2014 09:37 |
Thomas Elskens Messages: 159 Registered: September 2014 Location: Brussels - Belgium |
Senior Member |
|
|
Hello,
I had a declarative service (named IConnectorService) in which I wanted to use eclipse context, so I "transformed" it to a contextfunction.
So far so good : but I have another service, named IIndicatorService, which was referencing this service :
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="IIndicatorService">
<implementation class="serviceimplementations.IndicatorServiceImpl"/>
<service>
<provide interface="be.groups.kernel.prestanew.portefeuilleclients.service.indicators.IIndicatorService"/>
</service>
<reference bind="setConnectorService" cardinality="1..1" interface="be.groups.kernel.prestanew.portefeuilleclients.service.connexion.IConnectorService" name="IConnectorService" policy="static" unbind="unsetConnectorService"/>
</scr:component>
The referencing service fails to load now, throwing this error : "org.eclipse.e4.core.di.InjectionException: Unable to process "IndicatorDetailPart.indicatorService": no actual value was found for the argument "IIndicatorService"".
I presume some changes have to be made, as this ConnectorService only provides the IContextFunction interface, and no longer its own, but I don't see how this can be done.
So my question, in short : how can I make a reference, in a declarative service, to a context function?
|
|
|
Re: How to consume/reference context functions [message #1443859 is a reply to message #1443850] |
Mon, 13 October 2014 09:54 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
You need to rework your IIndicatorService to a context function as well
and use DI to get to the IConnectorService.
Tom
On 13.10.14 11:37, Thomas Elskens wrote:
> Hello,
>
> I had a declarative service (named IConnectorService) in which I wanted
> to use eclipse context, so I "transformed" it to a contextfunction.
> So far so good : but I have another service, named IIndicatorService,
> which was referencing this service :
>
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
> name="IIndicatorService">
> <implementation class="serviceimplementations.IndicatorServiceImpl"/>
> <service>
> <provide
> interface="be.groups.kernel.prestanew.portefeuilleclients.service.indicators.IIndicatorService"/>
>
> </service>
> <reference bind="setConnectorService" cardinality="1..1"
> interface="be.groups.kernel.prestanew.portefeuilleclients.service.connexion.IConnectorService"
> name="IConnectorService" policy="static" unbind="unsetConnectorService"/>
> </scr:component>
>
>
> The referencing service fails to load now, throwing this error :
> "org.eclipse.e4.core.di.InjectionException: Unable to process
> "IndicatorDetailPart.indicatorService": no actual value was found for
> the argument "IIndicatorService"".
>
> I presume some changes have to be made, as this ConnectorService only
> provides the IContextFunction interface, and no longer its own, but I
> don't see how this can be done.
> So my question, in short : how can I make a reference, in a declarative
> service, to a context function?
|
|
|
Powered by
FUDForum. Page generated in 0.02631 seconds