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. -Mike
