|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.security.HstSubject
public class HstSubject
Wrapper for the javax.security.auth.Subject class. Due to a design oversight in JAAS 1.0, the javax.security.auth.Subject.getSubject method does not return the Subject that is associated with the running thread !inside! a java.security.AccessController.doPrivileged code block. As a result, the current subject cannot be determined correctly. This class uses the ThreadLocal mechanism to carry the thread-specific instance of the subject
Method Summary | ||
---|---|---|
static void |
clearSubject()
Clear subject reference in current thread. |
|
static
|
doAs(Subject subjectInput,
PrivilegedAction<T> action)
Perform work as a particular Subject after setting subject reference in current thread |
|
static
|
doAs(Subject subjectInput,
PrivilegedExceptionAction<T> action)
Perform work as a particular Subject after setting subject reference in current thread. |
|
static
|
doAsPrivileged(Subject subjectInput,
PrivilegedAction<T> action,
AccessControlContext acc)
Perform privileged work as a particular Subject after setting subject reference in current thread. |
|
static
|
doAsPrivileged(Subject subjectInput,
PrivilegedExceptionAction<T> action,
AccessControlContext acc)
Perform privileged work as a particular Subject after setting subject reference in current thread. |
|
static Subject |
getSubject(AccessControlContext acc)
Get the Subject associated with the provided
AccessControlContext fromn the current Thread or from the standard SUBJECT mechansim |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Subject getSubject(AccessControlContext acc)
Subject
associated with the provided
AccessControlContext
fromn the current Thread or from the standard SUBJECT mechansim
public static <T> T doAs(Subject subjectInput, PrivilegedAction<T> action)
Subject
after setting subject reference in current thread
public static <T> T doAs(Subject subjectInput, PrivilegedExceptionAction<T> action) throws PrivilegedActionException
Subject
after setting subject reference in current thread.
PrivilegedActionException
public static <T> T doAsPrivileged(Subject subjectInput, PrivilegedAction<T> action, AccessControlContext acc)
Subject
after setting subject reference in current thread.
public static <T> T doAsPrivileged(Subject subjectInput, PrivilegedExceptionAction<T> action, AccessControlContext acc) throws PrivilegedActionException
Subject
after setting subject reference in current thread.
PrivilegedActionException
public static void clearSubject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |