Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Access control in Java -- doPrivileged

Previously we have introduced how Java performs permission check to protect resource access. What if sometimes we need to give some class the temporary access to some resource which it initially doesn't have? AccessController provides six doPrivileged methods to fulfill this requirement.These six methods have below signatures :static T doPrivileged(PrivilegedAction action)static T doPrivileged(PrivilegedAction action, AccessControlContext context)static T doPrivileged(PrivilegedExceptionAction action)static T doPrivileged(PrivilegedExceptionAction action, AccessControlContext context)stat...

3,477 0       JAVA SECURITY DOPRIVILEGED