AccessController usage
You would use AccessController.doPrivileged() to give certain code privileges that code earlier in the calling stack DOES NOT have but which the privileged codes DOES have by virtue of that privilege being granted in a policy. For example, assume ClassA invokes methods on ClassB, and ClassB needs to read the java.home system property (to borrow … Read more