-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkPermission
(Permission perm) Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the running program is allowed to access the resource being guarded by the given Permission argument.static <T> T
doPrivileged
(PrivilegedAction<T> action) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.static <T> T
doPrivileged
(PrivilegedAction<T> action, AccessControlContext context) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.static <T> T
doPrivileged
(PrivilegedAction<T> action, AccessControlContext context, Permission... perms) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.static <T> T
doPrivileged
(PrivilegedExceptionAction<T> action) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.static <T> T
doPrivileged
(PrivilegedExceptionAction<T> action, AccessControlContext context) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.static <T> T
doPrivileged
(PrivilegedExceptionAction<T> action, AccessControlContext context, Permission... perms) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.static <T> T
doPrivilegedWithCombiner
(PrivilegedAction<T> action) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.static <T> T
doPrivilegedWithCombiner
(PrivilegedAction<T> action, AccessControlContext context, Permission... perms) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.static <T> T
Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.static <T> T
doPrivilegedWithCombiner
(PrivilegedExceptionAction<T> action, AccessControlContext context, Permission... perms) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.static AccessControlContext
Deprecated, for removal: This API element is subject to removal in a future version.Answers the access controller context of the current thread, including the inherited ones.
-
Method Details
-
checkPermission
Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the running program is allowed to access the resource being guarded by the given Permission argument.- Parameters:
perm
- the permission to check- Throws:
AccessControlException
- if access is not allowed. NullPointerException if perm is null
-
getContext
Deprecated, for removal: This API element is subject to removal in a future version.Answers the access controller context of the current thread, including the inherited ones. It basically retrieves all the protection domains from the calling stack and creates anAccessControlContext
with them.- Returns:
- an AccessControlContext which captures the current state
- See Also:
-
doPrivileged
Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.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 other words, the check stops here. Any unchecked exception generated by this method will propagate up the chain.
- Type Parameters:
T
- the type of value returned by PrivilegedAction.run- Parameters:
action
- The PrivilegedAction to performed- Returns:
- the result of the PrivilegedAction
- Throws:
NullPointerException
- if action is null- See Also:
-
doPrivileged
Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.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 other words, 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.- Type Parameters:
T
- the type of value returned by PrivilegedAction.run- Parameters:
action
- The PrivilegedAction to performedcontext
- The AccessControlContext to check- Returns:
- the result of the PrivilegedAction
- Throws:
NullPointerException
- if action is null- See Also:
-
doPrivileged
public static <T> T doPrivileged(PrivilegedExceptionAction<T> action) throws PrivilegedActionException Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.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 other words, 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
- Type Parameters:
T
- the type of value returned by PrivilegedExceptionAction.run- Parameters:
action
- The PrivilegedExceptionAction to performed- Returns:
- the result of the PrivilegedExceptionAction
- Throws:
PrivilegedActionException
- when a checked exception occurs when performing the action NullPointerException if action is null- See Also:
-
doPrivileged
public static <T> T doPrivileged(PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.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 other words, 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- Type Parameters:
T
- the type of value returned by PrivilegedExceptionAction.run- Parameters:
action
- The PrivilegedExceptionAction to performedcontext
- The AccessControlContext to check- Returns:
- the result of the PrivilegedExceptionAction
- Throws:
PrivilegedActionException
- when a checked exception occurs when performing the action NullPointerException if action is null- See Also:
-
doPrivilegedWithCombiner
Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.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 other words, the check stops here. Any unchecked exception generated by this method will propagate up the chain.
- Type Parameters:
T
- the type of value returned by PrivilegedAction.run- Parameters:
action
- The PrivilegedAction to performed- Returns:
- the result of the PrivilegedAction
- See Also:
-
doPrivilegedWithCombiner
public static <T> T doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action) throws PrivilegedActionException Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.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 other words, 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
- Type Parameters:
T
- the type of value returned by PrivilegedExceptionAction.run- Parameters:
action
- The PrivilegedExceptionAction to performed- Returns:
- the result of the PrivilegedExceptionAction
- Throws:
PrivilegedActionException
- when a checked exception occurs when performing the action- See Also:
-
doPrivileged
public static <T> T doPrivileged(PrivilegedAction<T> action, AccessControlContext context, Permission... perms) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.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
and also granted by one of the permissions arguments. Any unchecked exception generated by this method will propagate up the chain.- Type Parameters:
T
- the type of value returned by PrivilegedAction.run- Parameters:
action
- The PrivilegedAction to performedcontext
- The AccessControlContext to checkperms
- The Permission arguments to limit the scope of the caller's privileges.- Returns:
- the result of the PrivilegedAction
- Throws:
NullPointerException
- if action is null- Since:
- 1.8
- See Also:
-
doPrivilegedWithCombiner
public static <T> T doPrivilegedWithCombiner(PrivilegedAction<T> action, AccessControlContext context, Permission... perms) Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.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 one of the permissions arguments. Any unchecked exception generated by this method will propagate up the chain.
- Type Parameters:
T
- the type of value returned by PrivilegedAction.run- Parameters:
action
- The PrivilegedAction to performedcontext
- The AccessControlContext to checkperms
- The Permission arguments to limit the scope of the caller's privileges.- Returns:
- the result of the PrivilegedAction
- Since:
- 1.8
- See Also:
-
doPrivileged
public static <T> T doPrivileged(PrivilegedExceptionAction<T> action, AccessControlContext context, Permission... perms) throws PrivilegedActionException Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
.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
and also granted by one of the permissions arguments. Any unchecked exception generated by this method will propagate up the chain. However, checked exceptions will be caught an re-thrown as PrivilegedActionExceptions- Type Parameters:
T
- the type of value returned by PrivilegedExceptionAction.run- Parameters:
action
- The PrivilegedExceptionAction to performedcontext
- The AccessControlContext to checkperms
- The Permission arguments to limit the scope of the caller's privileges.- Returns:
- the result of the PrivilegedExceptionAction
- Throws:
PrivilegedActionException
- when a checked exception occurs when performing the action NullPointerException if action is null- Since:
- 1.8
- See Also:
-
doPrivilegedWithCombiner
public static <T> T doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action, AccessControlContext context, Permission... perms) throws PrivilegedActionException Deprecated, for removal: This API element is subject to removal in a future version.Performs the privileged action specified byaction
, retaining any current DomainCombiner.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 and also granted by one of the permissions arguments. Any unchecked exception generated by this method will propagate up the chain. However, checked exceptions will be caught an re-thrown as PrivilegedActionExceptions
- Type Parameters:
T
- the type of value returned by PrivilegedExceptionAction.run- Parameters:
action
- The PrivilegedExceptionAction to performedcontext
- The AccessControlContext to checkperms
- The Permission arguments to limit the scope of the caller's privileges.- Returns:
- the result of the PrivilegedExceptionAction
- Throws:
PrivilegedActionException
- when a checked exception occurs when performing the action- Since:
- 1.8
- See Also:
-