You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by nino martinez wael <ni...@gmail.com> on 2015/06/03 11:06:10 UTC

Re: Service ranking only has effect during bundle startup?

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

On Wed, May 27, 2015, 12:02 Achim Nierbeck <bc...@googlemail.com> 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 <
> nino.martinez.wael@gmail.com>:
>
>> No ideas?
>>
>> On Wed, May 20, 2015 at 2:01 PM, nino martinez wael
>> <ni...@gmail.com> 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
>
>

Re: Service ranking only has effect during bundle startup?

Posted by Achim Nierbeck <bc...@googlemail.com>.
well you get the highest ranked service at the time the service is
available.
But it won't be re-wired to a higher ranked service if that comes up.

regards, Achim

2015-06-03 11:06 GMT+02:00 nino martinez wael <ni...@gmail.com>
:

> I was expecting to get the highest ranked service based on what's
> available..
>
> On Wed, May 27, 2015, 12:02 Achim Nierbeck <bc...@googlemail.com>
> 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 <
>> nino.martinez.wael@gmail.com>:
>>
>>> No ideas?
>>>
>>> On Wed, May 20, 2015 at 2:01 PM, nino martinez wael
>>> <ni...@gmail.com> 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
>>
>>


-- 

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

Re: Service ranking only has effect during bundle startup?

Posted by Christian Schneider <ch...@die-schneider.net>.
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 <bcanhome@googlemail.com 
> <ma...@googlemail.com>> 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
>     <nino.martinez.wael@gmail.com <ma...@gmail.com>>:
>
>         No ideas?
>
>         On Wed, May 20, 2015 at 2:01 PM, nino martinez wael
>         <nino.martinez.wael@gmail.com
>         <ma...@gmail.com>> 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
>