Hello, From previous emails on this list, I take it that this list is the best place to post questions from newbies (developers making use of existing OSGi implementations).
Having looked around for information on when to uses the "uses" directive for the last 3 days I am now at a loss and decided to post a question to this mailing list instead Short summary of what I understand (having read a number of blog entries and even attempting to read chapter 3 in the specification) the uses directive continues to be a mystery. In the interest of explaining my question, I have stolen the example below from http://felix.apache.org/site/presentations.data/osgi-berlin-20070321.pdf specifically slides 30-37. Initial state of OSGi container A: Export-Package : foo D: Export-Package : foo Assuming the state of these bundles in now 'active' New bundle added to the container C : Import-Package: foo, bar Package bar is not available, hence this bundle stays in state 'installed' i.e. is not resolved at this time B: Import-Package: foo Export-Package: bar; uses:="foo" Bundle is resolved by selecting bundle A as the provider for the package foo Bundle C can now be resolved by selecting bundle B as the provider for package bar, resolution on package foo (this is where the slides indicate the application of uses directive) is done by selecting bundle A as the provider for foo. Question : I do not understand the need for the "uses" directive here, tho there are potentially 2 providers for the interface 'foo' the requirement of class space consistency is easily achieved by existing class space affinity, i.e. why would the container not attempt to resolve package 'foo' using the previously determined class space without the need of the "uses" directive. It would also be great if someone could point me to an example that I could deploy in an OSGi container which actually results in a failure, I tried this more than a few times but just could not get a Class*Exception. Thanks Bhaskar _______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev