This figure shows the code flow for the doAs() and doAsPrivileged() methods.
For doAs(), it shows the flow as follows:
Subject.doAs()
createContext(Subject, currentACC)
AccessController.doPrivileged()
PrivilegedAction() {Public Object run() {AccessController.checkPerission(perm); }}
For doAsPrivileged(), it shows the flow as follows:
Subject.doAsPrivileged()
createContext(Subject, null/specifiedACC)
AccessController.doPrivileged()
PrivilegedAction() {Public Object run() {Admin.modifyPwdFile(); }}
(End of description.)