|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||||
| JavaTM 2 Platform Std. Ed. v1.6.0
java.security
|
|||||||||||||||||||||||||||
| Method Summary | ||
|---|---|---|
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. |
|
static
|
doPrivileged(PrivilegedAction<T> action)
Performs the specified PrivilegedAction with privileges
enabled. |
|
static
|
doPrivileged(PrivilegedAction<T> action,
AccessControlContext context)
Performs the specified PrivilegedAction with privileges
enabled and restricted by the specified
AccessControlContext. |
|
static
|
doPrivileged(PrivilegedExceptionAction<T> action)
Performs the specified PrivilegedExceptionAction with
privileges enabled. |
|
static
|
doPrivileged(PrivilegedExceptionAction<T> action,
AccessControlContext context)
Performs the specified PrivilegedExceptionAction with
privileges enabled and restricted by the specified
AccessControlContext. |
|
static
|
doPrivilegedWithCombiner(PrivilegedAction<T> action)
Performs the specified PrivilegedAction with privileges
enabled. |
|
static
|
doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action)
Performs the specified PrivilegedExceptionAction with
privileges enabled. |
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> T doPrivileged(PrivilegedAction<T> action)
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.
Note that any DomainCombiner associated with the current AccessControlContext will be ignored while the action is performed.
action - the action to be performed.
run method.
NullPointerException - if the action is nulldoPrivileged(PrivilegedAction,AccessControlContext),
doPrivileged(PrivilegedExceptionAction),
doPrivilegedWithCombiner(PrivilegedAction),
DomainCombinerpublic static <T> T doPrivilegedWithCombiner(PrivilegedAction<T> action)
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.
action - the action to be performed.
run method.
NullPointerException - if the action is nulldoPrivileged(PrivilegedAction),
DomainCombinerpublic static <T> T doPrivileged(PrivilegedAction<T> action, AccessControlContext context)
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.
action - the action to be performed.context - an access control context
representing the restriction to be applied to the
caller's domain's privileges before performing
the specified action. If the context is
null,
then no additional restriction is applied.
run method.
NullPointerException - if the action is nulldoPrivileged(PrivilegedAction),
doPrivileged(PrivilegedExceptionAction,AccessControlContext)public static <T> T doPrivileged(PrivilegedExceptionAction<T> action) throws PrivilegedActionException
PrivilegedExceptionAction 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.
Note that any DomainCombiner associated with the current AccessControlContext will be ignored while the action is performed.
action - the action to be performed
run method
PrivilegedActionException - if the specified action's
run method threw a checked exception
NullPointerException - if the action is nulldoPrivileged(PrivilegedAction),
doPrivileged(PrivilegedExceptionAction,AccessControlContext),
doPrivilegedWithCombiner(PrivilegedExceptionAction),
DomainCombinerpublic static <T> T doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action) throws PrivilegedActionException
PrivilegedExceptionAction 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.
action - the action to be performed.
run method
PrivilegedActionException - if the specified action's
run method threw a checked exception
NullPointerException - if the action is nulldoPrivileged(PrivilegedAction),
doPrivileged(PrivilegedExceptionAction,AccessControlContext),
DomainCombinerpublic static <T> T doPrivileged(PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException
PrivilegedExceptionAction with
privileges enabled and restricted by the specified
AccessControlContext. The action is performed with the
intersection of the 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.
action - the action to be performedcontext - an access control context
representing the restriction to be applied to the
caller's domain's privileges before performing
the specified action. If the context is
null,
then no additional restriction is applied.
run method
PrivilegedActionException - if the specified action's
run method
threw a checked exception
NullPointerException - if the action is nulldoPrivileged(PrivilegedAction),
doPrivileged(PrivilegedExceptionAction,AccessControlContext)public static AccessControlContext getContext()
AccessControlContextpublic static void checkPermission(Permission perm) throws AccessControlException
perm - the requested permission.
AccessControlException - if the specified permission
is not permitted, based on the current security policy.
NullPointerException - if the specified permission
is null and is checked based on the
security policy currently in effect.