Returns an array of ProtectionDomain from the classes on the stack, from the specified depth up to the first privileged frame, or the end of the stack if there is not a privileged frame. The array may be larger than required, but must be null terminated. As bootstrap classes have all permissions, bootstrap class frames SHOULD be skipped. Bootstrap class frames MUST be skipped if the ProtectionDomain of bootstrap classes is null. Duplicate ProtectionDomains SHOULD be removed.

The first element of the result is the AccessControlContext, which may be null, either from the privileged frame, or from the current Thread if there is not a privileged frame.

When permission checks are made, if the permission has been granted by all frames below and including the one representing the call to this method, then the permission is granted. In otherwords, the check stops here.

Any unchecked exception generated by this method will propagate up the chain.

When permission checks are made, if the permission has been granted by all frames below and including the one representing the call to this method, then the permission is granted iff it is granted by the AccessControlContextcontext. In otherwords, no more checking of the current stack is performed. Instead, the passed in context is checked.

Any unchecked exception generated by this method will propagate up the chain.

Parameters:

action

the action being performed

<T>

the return type for the privileged action

context

the context being checked for the privileged action

Returns:

the result of evaluating the action

See also:

doPrivileged(PrivilegedAction)

static <T> T java.security.AccessController.doPrivileged

(

PrivilegedExceptionAction< T >

action

)

throws PrivilegedActionException [static]

Performs the privileged action specified by action.

When permission checks are made, if the permission has been granted by all frames below and including the one representing the call to this method, then the permission is granted. In otherwords, the check stops here.

Any unchecked exception generated by this method will propagate up the chain. However, checked exceptions will be caught an re-thrown as PrivilegedActionExceptions.

When permission checks are made, if the permission has been granted by all frames below and including the one representing the call to this method, then the permission is granted iff it is granted by the AccessControlContextcontext. In otherwords, no more checking of the current stack is performed. Instead, the passed in context is checked.

Any unchecked exception generated by this method will propagate up the chain. However, checked exceptions will be caught an re-thrown as PrivilegedActionExceptions

Parameters:

action

the action being performed

<T>

the return type for the privileged action

context

the context being checked for the privileged action

Returns:

the result of evaluating the action

Exceptions:

PrivilegedActionException

if a checked exception was thrown

See also:

doPrivileged(PrivilegedAction)

The documentation for this class was generated from the following file: