On 10/19/06, Benjamin Schmaus <[EMAIL PROTECTED]> wrote:
> I knew about spring-osgi. I really wanted to know how to let an existing
> class retrieve resources from another bundle

Like Peter Kriens said, the Bundle object provides methods for
retrieving resources from a given bundle, namely,
Bundle.getEntry(String resource) and Bundle.findEntries(String path,
String filePattern, boolean recurse).

In the past I've used a BundleListener to inspect bundle's that have
been INSTALLED to see if they provide a "conf/testng.xml" file, and if
so add them to a datastructure that can be used to locate bundles that
provide TestNG unit tests, which can later be run from a UI.

Joe,
if I understand you correctly, you are essentially trying to grasp how to create bundles that are agnostic of future providers of resources (such as classes), yet use those resources as if they were available on the classpath as most legacy frameworks assumes.

If so, Peter and Benjamin are very accurate, and if you want to check some actual code out, you could peek at Pax Wicket in https://scm.ops4j.org/repos/ops4j/projects/pax/wicket/service , which does exactly that. Can't quite remember what happens where, but if you want more precise pointers, I will look that up tomorrow, or perhaps Edward can point you in the right direction...


Cheers
Niclas
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to