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?

Thanks,
Sahoo

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

Reply via email to