|
Final | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--java.security.AccessController
Checks access to system resources. Supports marking of code as priveleged. Makes context snapshots to allow checking from other contexts.
| Method Summary | |
|---|---|
static void |
checkPermission(Permission perm)
Checks whether the running program is allowed to access the resource being guarded by the given Permission argument. |
static Object |
doPrivileged(PrivilegedAction action)
Performs the privileged action specified by action.
|
static Object |
doPrivileged(PrivilegedAction action,
AccessControlContext context)
Performs the privileged action specified by action.
|
static Object |
doPrivileged(PrivilegedExceptionAction action)
Performs the privileged action specified by action.
|
static Object |
doPrivileged(PrivilegedExceptionAction action,
AccessControlContext context)
Performs the privileged action specified by action.
|
static AccessControlContext |
getContext()
Answers the access controller context of the current thread, including the inherited ones. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void checkPermission(Permission perm)
throws AccessControlException
perm - the permission to check
AccessControlException - if access is not allowed.public static AccessControlContext getContext()
AccessControlContext with them.
AccessControlContextpublic static Object doPrivileged(PrivilegedAction action)
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.
action - The PrivilegedAction to performed
doPrivileged(PrivilegedAction)public static Object doPrivileged(PrivilegedAction action,
AccessControlContext context)
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 iff it is granted by the AccessControlContext
context. 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.
action - The PrivilegedAction to performedcontext - The AccessControlContext to check
doPrivileged(PrivilegedAction)public static Object doPrivileged(PrivilegedExceptionAction action)
throws PrivilegedActionException
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
action - The PrivilegedExceptionAction to performed
PrivilegedActionException - when a checked exception occurs when performing the actiondoPrivileged(PrivilegedAction)public static Object doPrivileged(PrivilegedExceptionAction action,
AccessControlContext context)
throws PrivilegedActionException
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 iff it is granted by the AccessControlContext
context. 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
action - The PrivilegedExceptionAction to performedcontext - The AccessControlContext to check
PrivilegedActionException - when a checked exception occurs when performing the actiondoPrivileged(PrivilegedAction)
|
Final | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||