It is not ambiguous because if an Import-Package can not be matched
the bundle can not be resolved. You can make an imported package
optional, in that case it will resolve but the import is ignored at
resolve time (it will not be wired) and the internal packages will be
used according to the description.

So the premise that you can resolve with an unmatched import is not
right. The description you quote assumes the bundle is resolved
otherwise no classes are loaded from it.

Kind regards,

     Peter Kriens
     




EE> On 12/7/06, Niclas Hedhman <[EMAIL PROTECTED]> wrote:
>> Well, AFAIU, it seems legal to have Import-Package of classes that are
>> available internal to the bundle (see 3.8.4), and still have it resolved even
>> if there is no Export-Package in the system.

EE> I read it over last night and came to the conclusion that it
EE> terminates in step 3:

EE> "If the class or resource is in a package that is imported using Import-
EE> Package or was imported dynamically in a previous load, then the
EE> request is delegated to the exporting bundle's class loader; otherwise the
EE> search continues with the next step." (3.8.4, step 3)

EE> I re-read it with fresh(er) eyes and now I think it's ambiguous. It
EE> doesn't explicitly say how to handle Import-Packages that can't be
EE> matched to Export-Packages (I read the "otherwise" clause to be
EE> attached to "if Import-Package" not to "if found(Export-Package)").

EE> I ran a test on Knopflerfish (sorry) and they terminate in 3 (rejects
EE> the bundle with a BundleException because of missing or unresolved
EE> packages). It seems like the reasonable thing to do since it avoids
EE> your indeterministic scenario. Furthermore, it seems more analogous
EE> with (my understanding of) embedded or inlined jars: "Framework, from
EE> this point of view I'm an autonomous bundle. Don't you worry about
EE> these particular dependencies."

EE> Cheers,

EE> -EE

-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599

Reply via email to