I agree. This is likely an oversight in the implementation. Can you open a bug report against equinox?
Thanks..
Tom
From: Costin Leau <[EMAIL PROTECTED]>
To: [email protected]
Date: 08/15/2008 11:45 AM
Subject: Re: [osgi-dev] permissions and attached fragments
> How are you accessing the resources from the fragments?
>
> - Using the classloader? this.getClass().getClassLoader().getResource
> - Using Bundle.getResource?
Hi,
I'm actually using Bundle.findEntries(). The javadoc only mentions that
AdminPermission[this,RESOURCE] is required (which is assigned to the
host bundle).
Probably findEntries() uses the same behaviour as getResources() - i.e.
the fragment is considered a different bundle and, since the host
doesn't have a dedicated resource permission, it cannot find any resources.
I wonder though about the consistency of AdminPermission.class/resource
when dealing with fragments since the relationship between the host and
fragment is already supervised by the BundlePermission.
Once a fragment is attached, the classes that it contains should be
loadable by the hosting bundle (which creates the classloader in the
end) regardless of AdminPermissions (am I correct?).
So w/o any additional AdminPermission, if Bundle.load("classInFragment")
works then, in my opinion, so should Bundle.findEntries("package",
"classInFragment", false)).
If the AdminPermission.RESOURCE check can be bypassed using the class
loader directly (as in the example below), wouldn't it be more
consistent to have the same behaviour in the OSGi API as well?
Thanks,
--
Costin
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
