That is regarding the selection from the target services. Once the 
selected target service is bound, it must not change unless the bound 
service is unregistered. The impl is correctly following the spec.

The requested feature here is for the reference to "hunt" for the highest 
ranked service. So if the set of target services changes such that a 
target service has a higher ranking than the bound service, DS will 
deactivate the component (for static) or rebind the component (for 
dynamic) with the highest ranked target service.

Carsten, it is too late for this feature in the coming release. I suggest 
you open a bug in OSGi's public bugzilla to request this feature.
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
[email protected]

office: +1 386 848 1781
mobile: +1 386 848 3788





From:   Danail Nachev <[email protected]>
To:     OSGi Developer Mail List <[email protected]>
Date:   2011/01/14 07:03
Subject:        Re: [osgi-dev] [DS] Improve reference support ?
Sent by:        [email protected]



Hi Carsten,

Directly taken from OSGi R4.2 specification, 112.3.2, p307:

...
If the reference has a unary cardinality and there is more than one target
service for the reference, then the bound service must be the target 
service
with the highest service ranking as specified by the service.ranking 
property.
...

So, it seems that there is a bug in the DS implementation, rather than a 
problem
with the DS specification.

Danail Nachev
Lead Software Engineer/Development Tools
ProSyst Labs EOOD
-------------------------------------------------
stay in touch with your product.
-------------------------------------------------

On 1/14/2011 12:27 PM, Carsten Ziegeler wrote:
> Hi,
> 
> we're using declarative services a lot - it's usually sufficient and
> works pretty well :)
> 
> The only drawback we're facing - and I've heard this from others as well
> - is the lack of proper support for references and the service ranking
> property: once a reference is bound it is not updated if a new component
> providing the same service but with a higher service ranking arrives.
> So, it gets more unpredictable and depends on the startup order of
> services to what service such a reference is bound.
> In these cases, you can't use DS.
> 
> It would be great, to have a way to exactly define a reference that is
> always bound to the service with the highest ranking. To be compatible
> this has to be something new as we shouldn't change the current
> behaviour. So maybe adding a new optional property to the reference tag
> in the XML specifying if a rebound should happen due to service ranking
> or something along these lines.
> 
> WDYT?
> 
> Regards
> Carsten
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to