Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to retrieve/inject a list of services
https://www.eclipse.org/forums/index.php/mv/msg/238618/722419/#msg_722419
I use services to implement extensions to my domain model. All extensions implement the same interface. The question is, how can I retrieve all the implementations?
I tried the @Inject annotation with a list/array of my interface but it didn't work.
Then I tried the get method of the IEclipseContext but also got only one instance.
Funny thing: if I inject a single instance via annotation and retrieve another instance using the context I get two different implementations.
Any hints or is just not possible right now?
Best regards and thanks in advance
Hannes]]>Hannes Niederhausen2011-09-05T18:16:36-00:00Re: Hot to retrieve/inject a list of services
https://www.eclipse.org/forums/index.php/mv/msg/238618/722443/#msg_722443
configure using DS to receive all services and let you inject exactly
this one component.
This also solves the dynamic aspect of OSGi-Services currently not solve
by e4 DI by default.
Tom
Am 05.09.11 20:16, schrieb Hannes Niederhausen:
> Hi,
>
> I use services to implement extensions to my domain model. All
> extensions implement the same interface. The question is, how can I
> retrieve all the implementations?
>
> I tried the @Inject annotation with a list/array of my interface but it
> didn't work.
>
> Then I tried the get method of the IEclipseContext but also got only one
> instance.
>
> Funny thing: if I inject a single instance via annotation and retrieve
> another instance using the context I get two different implementations.
>
> Any hints or is just not possible right now?
>
> Best regards and thanks in advance
> Hannes]]>Thomas Schindl2011-09-05T19:09:39-00:00Re: Hot to retrieve/inject a list of services
https://www.eclipse.org/forums/index.php/mv/msg/238618/722444/#msg_722444
configure using DS to receive all services and let you inject exactly
this one component.
This also solves the dynamic aspect of OSGi-Services currently not solve
by e4 DI by default.
Tom
Am 05.09.11 20:16, schrieb Hannes Niederhausen:
> Hi,
>
> I use services to implement extensions to my domain model. All
> extensions implement the same interface. The question is, how can I
> retrieve all the implementations?
>
> I tried the @Inject annotation with a list/array of my interface but it
> didn't work.
>
> Then I tried the get method of the IEclipseContext but also got only one
> instance.
>
> Funny thing: if I inject a single instance via annotation and retrieve
> another instance using the context I get two different implementations.
>
> Any hints or is just not possible right now?
>
> Best regards and thanks in advance
> Hannes]]>Thomas Schindl2011-09-05T19:09:39-00:00Re: Hot to retrieve/inject a list of services
https://www.eclipse.org/forums/index.php/mv/msg/238618/722550/#msg_722550
thanks for the hint.
I was afraid it isn't possible at all in e4.
I still getting used to the component declarations, learning something new each day.
Best regards
Hannes]]>Hannes Niederhausen2011-09-06T07:09:23-00:00