| |
|
| java.lang.Object java.security.AccessController
AccessController | final public class AccessController (Code) | | |
Method Summary | |
public static void | checkPermission(Permission perm) Determines whether the access request indicated by the
specified permission should be allowed or denied, based on
the current AccessControlContext and security policy.
This method quietly returns if the access request
is permitted, or throws a suitable AccessControlException otherwise. | native public static T | doPrivileged(PrivilegedAction<T> action) Performs the specified PrivilegedAction with privileges
enabled. | native public static T | doPrivileged(PrivilegedAction<T> action, AccessControlContext context) Performs the specified PrivilegedAction with privileges
enabled and restricted by the specified
AccessControlContext .
The action is performed with the intersection of the permissions
possessed by the caller's protection domain, and those possessed
by the domains represented by the specified
AccessControlContext .
If the action's run method throws an (unchecked) exception,
it will propagate through this method.
Parameters: action - the action to be performed. Parameters: context - an access control contextrepresenting the restriction to be applied to thecaller's domain's privileges before performingthe specified action. | native public static T | doPrivileged(PrivilegedExceptionAction<T> action) Performs the specified PrivilegedExceptionAction with
privileges enabled. | native public static T | doPrivileged(PrivilegedExceptionAction<T> action, AccessControlContext context) Performs the specified PrivilegedExceptionAction with
privileges enabled and restricted by the specified
AccessControlContext . | public static T | doPrivilegedWithCombiner(PrivilegedAction<T> action) Performs the specified PrivilegedAction with privileges
enabled. | public static T | doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action) Performs the specified PrivilegedExceptionAction with
privileges enabled. | public static AccessControlContext | getContext() This method takes a "snapshot" of the current calling context, which
includes the current Thread's inherited AccessControlContext,
and places it in an AccessControlContext object. | native static AccessControlContext | getInheritedAccessControlContext() Returns the "inherited" AccessControl context. |
checkPermission | public static void checkPermission(Permission perm) throws AccessControlException(Code) | | Determines whether the access request indicated by the
specified permission should be allowed or denied, based on
the current AccessControlContext and security policy.
This method quietly returns if the access request
is permitted, or throws a suitable AccessControlException otherwise.
Parameters: perm - the requested permission. exception: AccessControlException - if the specified permissionis not permitted, based on the current security policy. exception: NullPointerException - if the specified permissionis null and is checked based on thesecurity policy currently in effect. |
doPrivileged | native public static T doPrivileged(PrivilegedAction<T> action, AccessControlContext context)(Code) | | Performs the specified PrivilegedAction with privileges
enabled and restricted by the specified
AccessControlContext .
The action is performed with the intersection of the permissions
possessed by the caller's protection domain, and those possessed
by the domains represented by the specified
AccessControlContext .
If the action's run method throws an (unchecked) exception,
it will propagate through this method.
Parameters: action - the action to be performed. Parameters: context - an access control contextrepresenting the restriction to be applied to thecaller's domain's privileges before performingthe specified action. If the context isnull ,then no additional restriction is applied. the value returned by the action's run method. exception: NullPointerException - if the action is null See Also: AccessController.doPrivileged(PrivilegedAction) See Also: AccessController.doPrivileged(PrivilegedExceptionAction,AccessControlContext) |
doPrivilegedWithCombiner | public static T doPrivilegedWithCombiner(PrivilegedAction<T> action)(Code) | | Performs the specified PrivilegedAction with privileges
enabled. The action is performed with all of the permissions
possessed by the caller's protection domain.
If the action's run method throws an (unchecked)
exception, it will propagate through this method.
This method preserves the current AccessControlContext's
DomainCombiner (which may be null) while the action is performed.
Parameters: action - the action to be performed. the value returned by the action's run method. exception: NullPointerException - if the action is null See Also: AccessController.doPrivileged(PrivilegedAction) See Also: java.security.DomainCombiner since: 1.6 |
getContext | public static AccessControlContext getContext()(Code) | | This method takes a "snapshot" of the current calling context, which
includes the current Thread's inherited AccessControlContext,
and places it in an AccessControlContext object. This context may then
be checked at a later point, possibly in another thread.
See Also: AccessControlContext the AccessControlContext based on the current context. |
getInheritedAccessControlContext | native static AccessControlContext getInheritedAccessControlContext()(Code) | | Returns the "inherited" AccessControl context. This is the context
that existed when the thread was created. Package private so
AccessControlContext can use it.
|
|
|
|