David,

You can use the getBundle(Class) method of the PackageAdmin service. To quote the JavaDocs:

"Returns the bundle from which the specified class is loaded. The class loader of the returned bundle must have been used to load the specified class. If the class was not loaded by a bundle class loader then null is returned."

Regards,
Neil

On 6 Jan 2009, at 08:20, David Leangen wrote:


Is there a way to determine which bundle a class comes from?

The problem we are having is that after having serialized a class, upon deserialization, there is no longer any class information available for
classes from private packages from other bundles. If we were aware of
which bundle that class came from (even those from private packages), we
could properly deserialize.


Thank you!



_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to