Thanks Richard S. Hall: Thanks you very much. I know it. What you have point out is just I need: bundles need use class of host application's specific class loader;
> -----Original----- > Sender: Richard S. Hall [mailto:[email protected]] > Date: 2011年6月21日 19:30 > Receiver: [email protected] > Subject: Re: How to specify a custom class loader as embedded felix's parent class > loader? > > On 6/21/11 12:25, ext2 wrote: > > Thanks Richard S. Hall. > > > >> The framework class must be loaded by a class loader by definition > > What's "definition" really means? > > All classes are loaded by a class loader. > > >> There is no standard way to define the framework class loader or its > >> parent. I don't think it would be possible to do this. However, it is > >> possible to define the parent class loader for bundles > >> (org.osgi.framework.bundle.parent or something property). This value is > >> only important when it comes to boot delegation, which generally isn't > >> used since it isn't very modular. > >> > > Is there any resource, I could find the exact property name? It seems this > > is what I want: passing the host application's class loader to Felix, and > > use it as system bundle's parent class loader. > > The OSGi spec or check the Felix framework usage document... > > The only reason why it is typically necessary to set the framework's > parent class loader is if you want to export packages from the system > bundle that are available on a specific class loader. > > -> richard > > >> -----Richard ----- > >> Sender: Richard S. Hall [mailto:[email protected]] > >> Date: 2011/6/21 17:16 > >> Receiver: [email protected] > >> Subject: Re: How to specify a custom class loader as embedded felix's > > parent class > >> loader? > >> > >> On 6/21/11 10:55, ext2 wrote: > >>> Hi: > >>> I am trying to embedded a felix framework in a application. > >>> But the application will create a custom class loader, as make the > > launched > >>> felix to use the class loader as its parent class loader. > >>> > >>> 1) Could anyone help me to explain how Felix framework know which > >>> class loader is it's parent class loader? the caller's class loader, > > thread > >>> context class loader or something else? > >> The framework class must be loaded by a class loader by definition. This > >> is the class loader that the framework will delegate to when it comes to > >> exposing "system" packages. > >> > >>> 2) Is the way of choosing classloader used by felix same as equinox? > >>> Does OSGI specification defined this? > >> There is no standard way to define the framework class loader or its > >> parent. I don't think it would be possible to do this. However, it is > >> possible to define the parent class loader for bundles > >> (org.osgi.framework.bundle.parent or something property). This value is > >> only important when it comes to boot delegation, which generally isn't > >> used since it isn't very modular. > >> > >> -> richard > >> > >>> Thanks any suggestion > >>> > >>> > >>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: [email protected] > >>> For additional commands, e-mail: [email protected] > >>> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

