[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.equinox] Find out bundle from BundleActivator

Hello

I am very new to OSGi and a bit confused.

Within the activator I get the BundleContext. But there are multiple
bundles installed there, so how do I find out which bundle belongs to
this Activator?
I would like to load properties or other files from either the bundle
itself or a fragment of it. The OSGi spec says that only
bundle.findEntries() is good for that.
But how do I find out which bundle this is? One approach would be this,
but I think there should be an easier way:

Bundle[] bundles = context.getBundles();
for(Bundle b : bundles)
	if(b.getHeaders().get("Bundle-Activator").equals(this.getClass().getName())
	return b;

Maybe I have missed something?

Thanks in advance,
Stefan Ackermann