I also would have expected this. I started work on a aries issue to provide this behaviour.

The last thing I did was check if the spec would allow this. The spec does not explicitly state this but Guillaume told me that indeed the intent of the spec was to not rewire to a new service. So my plan is to add an option as an extension so we keep the spec behaviour by default but also provide the behaviour you expected optionally.

You can follow the progress of this issue: https://issues.apache.org/jira/browse/ARIES-1314 As I currently have other things with higher prio it will take a bit. If you want to take a stab at it yourself I can help.

Christian

Am 03.06.2015 um 11:06 schrieb nino martinez wael:

I was expecting to get the highest ranked service based on what's available..


On Wed, May 27, 2015, 12:02 Achim Nierbeck <[email protected] <mailto:[email protected]>> wrote:

    I'm not sure I follow, what you expect to happen. It works as
    designed.
    Service Ranking is only used for resolving the services. If the
    Service is bound, no need to do a rewiring.
    How do you get a hold of the service? Are you using a ServiceTracker?
    In case of a Service Tracker you can react on new services and
    make sure you'll pick the one with the highest service rank yourself.
    Another possibility is to use DS and configure it accordingly, to
    actually rewire in case of a new Service with a higher ranking is
    available.

    regards, Achim


    2015-05-27 11:57 GMT+02:00 nino martinez wael
    <[email protected] <mailto:[email protected]>>:

        No ideas?

        On Wed, May 20, 2015 at 2:01 PM, nino martinez wael
        <[email protected]
        <mailto:[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



        --
        Best regards / Med venlig hilsen
        Nino Martinez




--
    Apache Member
    Apache Karaf <http://karaf.apache.org/> Committer & PMC
    OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
    Committer & Project Lead
    blog <http://notizblog.nierbeck.de/>
    Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

    Software Architect / Project Manager / Scrum Master


Reply via email to