Getting the bundle from the classloader? [message #63197] |
Tue, 07 March 2006 15:34 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
I recently blogged about <a href=" http://alblue.blogspot.com/2006/03/javaeclipse-running-all-t ests-in.html">running all tests in Eclipse</a>, using a dynamic mechanism to query all classes ending in *Test, instead of having to create an AllTests class manually. (Apart from anything else, it can selectively ignore platform tests as well as span projects.)
When I was implenting the code, I wanted to get hold of the Bundle that was associated with a particular class (e.g. via the classloader), to get the bundle name and from there the list of the bundle's contents. I couldn't find an easy way to do it, so in the end I went for an implementation that used conventions rather than a proper lookup (by using the package name and assuming package name == bundle name).
Is there a public API to query this information?
Alex.
|
|
|
|
|
Powered by
FUDForum. Page generated in 2.33695 seconds