The idea is that Felix can be loaded in different classloaders (and
that works just fine). So for a given value the classloader is
configurable.

I think what we could do is set the parent classloader of bundle
classloaders to be the classloader that loaded felix. Then at least we
are consistent...

regards,

Karl


On Tue, Apr 1, 2008 at 2:26 PM, Stuart McCulloch
<[EMAIL PROTECTED]> wrote:
>
> On 01/04/2008, Sahoo <[EMAIL PROTECTED]> wrote:
>  >
>  > Stuart McCulloch wrote:
>  > > On 01/04/2008, Sahoo <[EMAIL PROTECTED]> wrote:
>  > >
>  > >> Richard S. Hall wrote:
>  > >>
>  > >>> Sahoo wrote:
>  > >>>
>  > >>>> I would have to agree that the spec does not mandate this, but won't
>  > >>>> it be nice to allow users to set the parent class loader as per their
>  > >>>> requirement? Defaulting to system classloader can be very dangerous
>  > >>>> at times. More over, ability to specify this is better, I believe.
>  > >>>> Equinox allows users to configure the parent [1].
>  > >>>>
>  > >>> Yes, I agree it might be nice to make this configurable.
>  > >>>
>  > >>>
>  > >>>
>  > >> What is confusing is that although the parent is automatically set to
>  > >> "system class loader," it is not used for any kind of delegation.
>  > >> Instead, Felix delegates to the class loader that loaded Felix
>  > framework
>  > >> classes for any kind of class loading delegation. I am saying this
>  > based
>  > >> on the following code that I see in R4SearchPolicyCore.java:
>  > >>                        result = (isClass)
>  > >>                             ? (Object)
>  > >> getClass().getClassLoader().loadClass(name)
>  > >>                             : (Object)
>  > >> getClass().getClassLoader().getResource(name);
>  > >>
>  > >> If this is the only delegation point, then it should not be that
>  > >> difficult to provide a configuration point to user, should it?
>  > >>
>  > >
>  > >
>  > > FYI, remember OSGi doesn't follow the classic parent
>  > > classloader delegation model, which is why I think the
>  > > setting of the parent loader is really only of interest to
>  > > code that explicitly uses the ClassLoader.getParent()
>  > > method
>  > >
>  > > but it would still be useful to make this configurable
>  > > (ie. the setting of the parent loader, not the above
>  > >  search policy which I believe follows the spec...)
>  > >
>  > >
>  >
>  > The search policy is delegating to getClass().getClassLoader(). Where
>  > does the spec mandate it to delegate to the class loader that loads the
>  > framework? Can you please send a pointer to the spec?
>
>
>  sorry, that last bit wasn't clear - at the moment Felix is
>  delegating to the classloader that loaded the framework
>  so the actual parent loader is never used during bundle
>  classloader (only by code that explicitly calls getParent)
>
>  if we want to make this configurable then I think we'd
>  need to set the parent loader according to the settings
>  and then always use the parent loader in the above
>  search in place of the framework delegation*
>
>  we shouldn't just change the search policy but leave
>  the bundle's parent loader set to the system loader,
>  as that would keep the inconsistency
>
>  (* the current search policy doesn't break the spec
>    because the spec doesn't mandate what parent is
>    used or where that parent comes from )
>
>
>
>  Thanks,
>  > Sahoo
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>
>
>  --
>  Cheers, Stuart
>



-- 
Karl Pauls
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to