Try using a ServiceTracker.

https://osgi.org/javadoc/r4v42/org/osgi/util/tracker/ServiceTracker.html#getServiceReference()

On Wed, May 20, 2015 at 8:01 AM nino martinez wael <
[email protected]> wrote:

> Hi
>
> Are there any way to specify service loading so that the highest
> available ranked service will always be used no matter which state the
> bundle are in, currently it only loads the highest available service
> on load of the bundle.
>
> This means if I have 3 bundles, A,B and C. C uses either A or B. B are
> ranked 2 and A are ranked 1.
>
> If I go ahead and start karaf load bundle A,B and then C. C will be
> refering to B. If I stop B, C then points to A. If I then start B,
> bundle C still points to A. When bundle B are started I want bundle C
> to point to automatically pickup service B.
>
> How can I achieve this?
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>

Reply via email to