This figure shows the code flow for the doAs() and doAsPrivileged() methods.

For doAs(), it shows the flow as follows:

  1. Subject.doAs()

  2. createContext(Subject, currentACC)

  3. AccessController.doPrivileged()

  4. PrivilegedAction() {Public Object run() {AccessController.checkPerission(perm); }}

For doAsPrivileged(), it shows the flow as follows:

  1. Subject.doAsPrivileged()

  2. createContext(Subject, null/specifiedACC)

  3. AccessController.doPrivileged()

  4. PrivilegedAction() {Public Object run() {Admin.modifyPwdFile(); }}

(End of description.)