Michael Warres wrote:
Quoting Mark Brouwer <[EMAIL PROTECTED]>:
However there is one hurdle I can't seem to take [1] and that is
dynamically assigning permissions the the protection domains associated
with the class loaders due to the fact that Dynamicpolicy doesn't
provide a method in which you could pass in a class loader, all methods
take a class as argument. The funny thing is though that the semantics
for this methods make it clear the permissions are really assigned to
the protection domains associated with the class loader [2] for the
class passed in. The actual DynamicPolicy provider implementation also
indicates that there seems to be no reason why the DynamicPolicy
interface can't support passing in a class loader.

FWIW, the API was fashioned this way since a caller might not have permission
to obtain the class loader of the class to which it wished to grant
permissions.  IIRC, I don't think there was anything intrinsically wrong with
passing in a class loader directly--there simply wasn't any use case at the
time to justify an additional method.

Hi Michael,

Forgot to respond on Vinod's posting mentioning that I'm aware why the
API is as it is, logical given its purpose of proxy preparation. I don't
know whether we should pursue the enhancements I first mentioned as
Vinod's 'trick' makes it possible to get what you want and probably it
will stay a rare use case, but if other feel different about this I have
no problem in creating an issue for it.
--
Mark

Reply via email to