On 19.03.2012 13:02, [email protected] wrote:
> But before we can create any proxy instance, the class needs to exist
> which means that some ClassLoader somewhere has to call defineClass().  Or
> am I missing something?

Unless I misunderstand what you are trying to achieve, your question
really is "how do I get the classloader for the bundle that is generating
the bytecode". This was framework-specific before 4.3 and since then has
been fixed via:

http://www.osgi.org/javadoc/r4v43/org/osgi/framework/Bundle.html#adapt%28java.lang.Class%29

using:

http://www.osgi.org/javadoc/r4v43/org/osgi/framework/wiring/BundleWiring.html

as target role. This will allow you to call:

http://www.osgi.org/javadoc/r4v43/org/osgi/framework/wiring/BundleWiring.html#getClassLoader()

Does that help?

-h
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to