Example of Guard on Protected Resource
. . .
/* Check to see if the calling code is authorized. If not, a SecurityException (AccessControlException) will be thrown */ AccessController.checkPermission( new RuntimePermission("queuePrintJob")); // Trusted code starts here. . . . |