Bundle-ClassPath and resource entries [message #685815] |
Mon, 20 June 2011 05:40  |
Eclipse User |
|
|
|
I am new to eclipse and plugin development environment. I wrote a plugin and have configured it to run as "OSGi framework". I see Equinox being launched and my plugin provisioned as shown below:
2 initial@reference:file:../../../../../../../../bugs/libra/plugin1/
ACTIVE plugin1_1.0.0.qualifier
I have another bundle which tries to inspect this plugin. It collects all entries in a bundle by recursively calling bundle.getEntry() as shown below:
private void getEntryPaths(Collection<String> entries, String path) {
Enumeration<String> subPaths = b.getEntryPaths(path);
if (subPaths != null) {
while (subPaths.hasMoreElements()) {
String next = subPaths.nextElement();
entries.add(next);
getEntryPaths(entries, next); // recursion
}
}
}
For the plugin bundle, the above code reported bundle entries as
bin/
bin/plugin1/
bin/plugin1/Activator.class
META-INF/
META-INF/MANIFEST.MF
src/
...
So far so good. What surprises me is that even though the activator class, plugin1.Activator.class, is inside bin/ folder, the Bundle-ClassPath header is not set in the bundle's metadata and yet Equinox is able to locate the activator. Can anyone please explain how Equinox locates the class from bin/ folder when the Bundle-ClassPath is not set to "bin?" Where is the magic of locating resources from bin folder happening?
Thanks much,
Sahoo
[Updated on: Mon, 20 June 2011 05:42] by Moderator
|
|
|
|
Re: Bundle-ClassPath and resource entries [message #685912 is a reply to message #685865] |
Mon, 20 June 2011 13:01  |
Eclipse User |
|
|
|
Tom,
Thanks for pointing out the bug. That's exactly what I am seeing. I must say I am surprised that the core of Equinox has been changed to handle this specific PDE use case. I guess the same result could be achieved via manifest rewriting using a url handler, but that probably would not have resulted in the kind of optimization that's achieved by avoiding to create a proper jar file in the first place. May I ask one question though? Since internally bin is being treated as a bundle classpath, why is the Bundle.getHeaders().get("Bundle-ClassPath") not reflecting the same?
Thanks,
Sahoo
|
|
|
Powered by
FUDForum. Page generated in 0.03735 seconds