felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: question about the osgi presentation in osgi-berlin-20070321.pdf
Date Fri, 06 Mar 2009 09:07:46 GMT
2009/3/6 Pierre De Rop <pierre.de_rop@alcatel-lucent.fr>

> Hello everyone;
>
> I have read the Richard's osgi presentation from
> http://cwiki.apache.org/FELIX/presentations.data/osgi-berlin-20070321.pdf
> and there is something in the slide 36 ("OSGI R4 modularity details 4/7,
> sophisticated class space consistency model")
> which I don't understand clearly.
> This slide is about the "uses" clause. The whole point of the slide 36 is
> to demonstrate that bundle* C* must not be wired to bundle *D*** (because of
> a potential linkage exception ...)
> This is clear for me.
>
> What is not clear is the following:
> we see in the slide that:
>
>   bundle A exports package "foo"
>   bundle D exports package "foo"
>
> so, in the osgi core specification, chapter 3.7, the following rules are
> applied, when the framework calculates bundle resolution for bundle C:
>
>      1. A resolved exporter must be preferred over an unresolved exporter.
>      2. An exporter with a higher version is preferred over an
>         exporter with  lower version.
>      3. An exporter with a lower bundle ID is preferred over a bundle
>         with higher ID.
>
> Now:
>
>   * if A (or D) is not RESOLVED, then rules 1 applies and we are sure
>     that both B/C will be wired to the same exporter for package foo
>     (the RESOLVED exporter will win)
>   * if A and D are both RESOLVED, then the rules 3 applies and we are
>     also sure that both B/C will be wired to same exporter for package
>     foo (with lower bundle ID)
>

what if A and B are installed and resolved - then later on D is installed
and resolved, and say D has a slightly higher version than A for "foo"
(perhaps only in the version qualifier)

then when we install C it would normally wire "foo" to D because it has
a higher version (depending of course on the import ranges used in C)
UNLESS there's a "uses" constraint to force it to choose A

here are some other blog entries about "uses" constraints:


http://underlap.blogspot.com/2007/10/osgi-type-safety-and-uses-directive.html
  http://blog.springsource.com/2008/11/22/diagnosing-osgi-uses-conflicts/

HTH

So, regarding the two cases above: what is the benefit of using the "uses"
> clause ?
> Could you please give me a use case which justify the usage of the "uses"
> clause ?
>
> Many thanks;
> /pierre
>

-- 
Cheers, Stuart

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message