Last Updated on March 20, 2022 by Admin 2
Which of the following statements are true about the doAs() and doAsPrivileged() methods?
Each correct answer represents a complete solution. Choose all that apply.
- The doAsPrivileged() method invokes AccessController.doPrivileged by passing it the provided PrivilegedAction.
- The doAs() and doAsPrivileged() methods perform privileged work as a particular Subject.
- The doAs() method retrieves the current Thread’s AccessControlContext via AccessController.getContext.
- The doAsPrivileged() method, instead of retrieving the current Thread’s AccessControlContext, uses the provided AccessControlContext.