java.lang.Object | |
↳ | java.security.AccessController |
AccessController
provides static methods to perform access control
checks and privileged operations.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks the specified permission against the VM's current security policy.
| |||||||||||
Returns the result of executing the specified privileged action.
| |||||||||||
Returns the result of executing the specified privileged action.
| |||||||||||
Returns the result of executing the specified privileged action.
| |||||||||||
Returns the result of executing the specified privileged action.
| |||||||||||
Returns the
AccessControlContext for the current Thread
including the inherited access control context of the thread that spawned
the current thread (recursively). |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Checks the specified permission against the VM's current security policy.
The check is performed in the context of the current thread. This method
returns silently if the permission is granted, otherwise an AccessControlException
is thrown.
A permission is considered granted if every ProtectionDomain
in
the current execution context has been granted the specified permission.
If privileged operations are on the execution context, only the ProtectionDomain
s from the last privileged operation are taken into
account.
This method delegates the permission check to
checkPermission(Permission)
on the current
callers' context obtained by getContext()
.
permission | the permission to check against the policy |
---|
AccessControlException | if the specified permission is not granted |
---|---|
NullPointerException | if the specified permission is null |
Returns the result of executing the specified privileged action. Only the
ProtectionDomain
of the direct caller of this method and the
ProtectionDomain
s of all subsequent classes in the call chain are
checked to be granted the necessary permission if access checks are
performed.
If a checked exception is thrown by the action's run method, it will be wrapped and propagated through this method.
If an instance of RuntimeException
is thrown during the execution
of the PrivilegedAction#run()
method of the given action, it will
be propagated through this method.
action | the action to be executed with privileges |
---|
PrivilegedActionException | if the action's run method throws any checked exception |
---|---|
NullPointerException | if the specified action is null
|
Returns the result of executing the specified privileged action. The
ProtectionDomain
of the direct caller of this method, the ProtectionDomain
s of all subsequent classes in the call chain and all
ProtectionDomain
s of the given context are checked to be granted
the necessary permission if access checks are performed.
If an instance of RuntimeException
is thrown during the execution
of the PrivilegedAction#run()
method of the given action, it will
be propagated through this method.
action | the action to be executed with privileges |
---|---|
context | the AccessControlContext whose protection domains are
checked additionally |
NullPointerException | if the specified action is null
|
---|
Returns the result of executing the specified privileged action. Only the
ProtectionDomain
of the direct caller of this method and the
ProtectionDomain
s of all subsequent classes in the call chain are
checked to be granted the necessary permission if access checks are
performed.
If an instance of RuntimeException
is thrown during the execution
of the PrivilegedAction#run()
method of the given action, it will
be propagated through this method.
action | the action to be executed with privileges |
---|
NullPointerException | if the specified action is null
|
---|
Returns the result of executing the specified privileged action. The
ProtectionDomain
of the direct caller of this method, the ProtectionDomain
s of all subsequent classes in the call chain and all
ProtectionDomain
s of the given context are checked to be granted
the necessary permission if access checks are performed.
If a checked exception is thrown by the action's run method, it will be wrapped and propagated through this method.
If an instance of RuntimeException
is thrown during the execution
of the PrivilegedAction#run()
method of the given action, it will
be propagated through this method.
action | the action to be executed with privileges |
---|---|
context | the AccessControlContext whose protection domains are
checked additionally |
PrivilegedActionException | if the action's run method throws any checked exception |
---|---|
NullPointerException | if the specified action is null
|
PrivilegedActionException |
---|
Returns the AccessControlContext
for the current Thread
including the inherited access control context of the thread that spawned
the current thread (recursively).
The returned context may be used to perform access checks at a later point in time, possibly by another thread.
AccessControlContext
for the current Thread