Hi Richard I see. In other words, if I'll use the dynamic priority binding policy (instead of just set the service ranking) I'll get the current ranking of the service? Is that what you meant?
Regards Shai Amar On Thu, Aug 11, 2011 at 4:37 PM, Richard S. Hall <[email protected]>wrote: > You'll have to use dynamic priority binding policy for the dependency so > that you are automatically switched based on service ranking...if you just > use dynamic binding policy for the dependency, then you'll just get the > highest ranking at the time of injection. > > -> richard > > > On 8/11/11 8:54 AM, Shai Amar wrote: > >> Thanks! >> It seems like an elegant solution. :) >> >> Regards >> Shai Amar >> >> On Thu, Aug 11, 2011 at 3:46 PM,<[email protected]> wrote: >> >> I think you would want to utilize the service ranking: >>> >>> When registering a service object, a >>> bundle may optionally specify a >>> service.ranking number as one of >>> the service object's properties. If >>> multiple qualifying service interfaces >>> exist, a service with the highest >>> SERVICE_RANKING number, or >>> when equal to the lowest >>> SERVICE_ID, determines which service >>> object is returned by the Framework. >>> >>> Make Aa the highest rank, Ab after that. That way it will get the Aa >>> service if available, Ab if not. >>> >>> David Humeniuk >>> >>> >>> -----Original Message----- >>> From: Shai Amar [mailto:shai.amar@krynnlance.**com<[email protected]> >>> ] >>> Sent: Thursday, August 11, 2011 8:42 AM >>> To: [email protected] >>> Subject: Re: iPOJO: How to use an alternate service when the current >>> service is unavailable? >>> >>> Hi David >>> >>> Still the question remains. >>> The log service is an example. >>> >>> If I have 2 service implementations Aa and Ab of interface A. >>> If I have a client that uses Aa and can use Ab. In case service Aa is >>> unavailable, is it possible via iPOJO to switch automatically to service >>> Ab? >>> >>> Regards >>> Shai Amar >>> >>> On Thu, Aug 11, 2011 at 3:22 PM,<[email protected]> wrote: >>> >>> Sounds like you should be using the LogReaderService for those >>>> implementations not the LogService. You can use the Felix Log Service >>>> bundle to get a LogService implementation and Log Service APIs. >>>> >>>> David Humeniuk >>>> >>>> >>>> -----Original Message----- >>>> From: Shai Amar >>>> [mailto:shai.amar@krynnlance.**com<[email protected]> >>>> ] >>>> Sent: Thursday, August 11, 2011 4:49 AM >>>> To: [email protected] >>>> Subject: iPOJO: How to use an alternate service when the current >>>> >>> service >>> >>>> is unavailable? >>>> >>>> Hi all >>>> >>>> I have the following situation: >>>> I have 2 Log service implementations implementing *LogService* >>>> interface: >>>> >>>> 1. *Console* log implementation >>>> 2. *RotatingFile* log implementation >>>> >>>> I want that a service SOME_SERVICE will use the *Console* log >>>> implementation >>>> service as a default, and if it is unavailable, SOME_SERVICE will use >>>> the * >>>> RotatingFile* log implementation service instead. >>>> >>>> Is it possible to do that? >>>> If it does, how can I do that? >>>> >>>> -- >>>> Regards >>>> >>>> Shai Amar >>>> >>>> Technologies manager, Founder >>>> Krynnlance >>>> www.krynnlance.com >>>> www.backapps.com >>>> >>>> ------------------------------**------------------------------** >>>> --------- >>>> To unsubscribe, e-mail: >>>> users-unsubscribe@felix.**apache.org<[email protected]> >>>> For additional commands, e-mail: [email protected] >>>> >>>> >>>> >>> -- >>> Regards >>> >>> Shai Amar >>> >>> Technologies manager, Founder >>> Krynnlance >>> www.krynnlance.com >>> www.backapps.com >>> >>> ------------------------------**------------------------------** >>> --------- >>> To unsubscribe, e-mail: >>> users-unsubscribe@felix.**apache.org<[email protected]> >>> For additional commands, e-mail: [email protected] >>> >>> >>> >> > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@felix.**apache.org<[email protected]> > For additional commands, e-mail: [email protected] > > -- Regards Shai Amar Technologies manager, Founder Krynnlance www.krynnlance.com www.backapps.com

