|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.security.JSSubject
public class JSSubject
Field Summary | |
---|---|
private static long |
serialVersionUID
|
(package private) static ThreadLocal |
threadLocal
|
Constructor Summary | |
---|---|
JSSubject()
|
Method Summary | |
---|---|
static Object |
doAs(Subject subject1,
PrivilegedAction action)
Perform work as a particular Subject after setting subject reference in current thread |
static Object |
doAs(Subject subject1,
PrivilegedExceptionAction action)
Perform work as a particular Subject after setting subject reference in current thread. |
static Object |
doAsPrivileged(Subject subject1,
PrivilegedAction action,
AccessControlContext acc)
Perform privileged work as a particular Subject after setting subject reference in current thread. |
static Object |
doAsPrivileged(Subject subject,
PrivilegedExceptionAction 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 |
Field Detail |
---|
private static final long serialVersionUID
static ThreadLocal threadLocal
Constructor Detail |
---|
public JSSubject()
Method Detail |
---|
public static Subject getSubject(AccessControlContext acc)
Subject
associated with the provided
AccessControlContext
fromn the current Thread or from the standard SUBJECT mechansim
acc
- the AccessControlContext
from which to retrieve
the Subject
. Only used if current thread doesn't carry subject
Subject
associated with the provided
AccessControlContext
, or null
if no Subject
is associated
with the provided AccessControlContext
.
SecurityException
- if the caller does not have permission
to get the Subject
.
NullPointerException
- if the provided
AccessControlContext
is null
.public static Object doAs(Subject subject1, PrivilegedAction action)
Subject
after setting subject reference in current thread
subject
- the Subject
that the specified
action
will run as. This parameter
may be null
. action
- the code to be run as the specified
Subject
.
Object
returned by the PrivilegedAction's
run
method.
NullPointerException
- if the PrivilegedAction
is null
.
SecurityException
- if the caller does not have permission
to invoke this method.public static Object doAs(Subject subject1, PrivilegedExceptionAction action) throws PrivilegedActionException
Subject
after setting subject reference in current thread.
subject
- the Subject
that the specified
action
will run as. This parameter
may be null
. action
- the code to be run as the specified
Subject
.
Object
returned by the
PrivilegedExceptionAction's run
method.
PrivilegedActionException
- if the
PrivilegedExceptionAction.run
method throws a checked exception.
NullPointerException
- if the specified
PrivilegedExceptionAction
is
null
.
SecurityException
- if the caller does not have permission
to invoke this method.public static Object doAsPrivileged(Subject subject1, PrivilegedAction action, AccessControlContext acc)
Subject
after setting subject reference in current thread.
subject
- the Subject
that the specified
action
will run as. This parameter
may be null
. action
- the code to be run as the specified
Subject
. acc
- the AccessControlContext
to be tied to the
specified subject and action.
Object
returned by the PrivilegedAction's
run
method.
NullPointerException
- if the PrivilegedAction
is null
.
SecurityException
- if the caller does not have permission
to invoke this method.public static Object doAsPrivileged(Subject subject, PrivilegedExceptionAction action, AccessControlContext acc) throws PrivilegedActionException
Subject
after setting subject reference in current thread.
subject
- the Subject
that the specified
action
will run as. This parameter
may be null
. action
- the code to be run as the specified
Subject
. acc
- the AccessControlContext
to be tied to the
specified subject and action.
Object
returned by the
PrivilegedExceptionAction's run
method.
PrivilegedActionException
- if the
PrivilegedExceptionAction.run
method throws a checked exception.
NullPointerException
- if the specified
PrivilegedExceptionAction
is
null
.
SecurityException
- if the caller does not have permission
to invoke this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |