public final class Security
extends java.lang.Object
Subject.doAs(Subject, PrivilegedAction) and
Subject.doAs(Subject, PrivilegedExceptionAction) when interaction with the
AccessControlContext is not needed.
N.B. this uses the caller's Package, this can easily be subverted by placing the
calling code within the org.infinispan hierarchy. However for most purposes this is ok.| Constructor and Description |
|---|
Security() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkPermission(CachePermission permission) |
static <T> T |
doAs(javax.security.auth.Subject subject,
java.security.PrivilegedAction<T> action)
A "lightweight" implementation of
Subject.doAs(Subject, PrivilegedAction) which uses a ThreadLocal
Subject instead of modifying the current AccessControlContext. |
static <T> T |
doAs(javax.security.auth.Subject subject,
java.security.PrivilegedExceptionAction<T> action)
A "lightweight" implementation of
Subject.doAs(Subject, PrivilegedExceptionAction) which uses a ThreadLocal
Subject instead of modifying the current AccessControlContext. |
static <T> T |
doPrivileged(java.security.PrivilegedAction<T> action) |
static <T> T |
doPrivileged(java.security.PrivilegedExceptionAction<T> action) |
static javax.security.auth.Subject |
getSubject()
If using
doAs(Subject, PrivilegedAction) or
doAs(Subject, PrivilegedExceptionAction), returns the Subject associated with the current thread
otherwise it returns the Subject associated with the current AccessControlContext |
static java.security.Principal |
getSubjectUserPrincipal(javax.security.auth.Subject s)
Returns the first principal of a subject which is not of type
Group |
static boolean |
isPrivileged() |
public static <T> T doPrivileged(java.security.PrivilegedAction<T> action)
public static <T> T doPrivileged(java.security.PrivilegedExceptionAction<T> action)
throws java.security.PrivilegedActionException
java.security.PrivilegedActionExceptionpublic static <T> T doAs(javax.security.auth.Subject subject,
java.security.PrivilegedAction<T> action)
Subject.doAs(Subject, PrivilegedAction) which uses a ThreadLocal
Subject instead of modifying the current AccessControlContext.Subject.doAs(Subject, PrivilegedAction)public static <T> T doAs(javax.security.auth.Subject subject,
java.security.PrivilegedExceptionAction<T> action)
throws java.security.PrivilegedActionException
Subject.doAs(Subject, PrivilegedExceptionAction) which uses a ThreadLocal
Subject instead of modifying the current AccessControlContext.java.security.PrivilegedActionExceptionSubject.doAs(Subject, PrivilegedExceptionAction)public static void checkPermission(CachePermission permission) throws java.security.AccessControlException
java.security.AccessControlExceptionpublic static boolean isPrivileged()
public static javax.security.auth.Subject getSubject()
doAs(Subject, PrivilegedAction) or
doAs(Subject, PrivilegedExceptionAction), returns the Subject associated with the current thread
otherwise it returns the Subject associated with the current AccessControlContextpublic static java.security.Principal getSubjectUserPrincipal(javax.security.auth.Subject s)
Group