Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to consume/reference context functions(Referenced service no longer found after I transformed it to Contextfunction)
How to consume/reference context functions [message #1443850] Mon, 13 October 2014 09:37 Go to next message
Thomas Elskens is currently offline Thomas ElskensFriend
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 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
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?
Previous Topic:How to create an View with parameters
Next Topic:Eclipse RCP: e3 editor in e4: "createPartProperties" never called
Goto Forum:
  


Current Time: Thu Apr 25 01:23:59 GMT 2024

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

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

Back to the top