|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.benow.java.run.RestartableRunner
org.benow.security.user.SubjectThread
@Deprecated public class SubjectThread
A SubjectThread is a BaseThread which executes PrivilegedActions via calls to doAs(Principal, PriviligedAction). The actions may then call Subject.assertPermission(Permission) (which calls SubjectThread.assertPermission(Permission)) to verify that the Pricipal which is associated with the current executing action has a specified permission.
This may seem to be a bit backwards, but the separation of SubjectThread and Subject is required for pooling purposes. The performance overhead due to user->action association is lessened due to this pooling, at the expense of memory usage.
Note: This thread is synchronized and can only handle one doAs() at a time. Pending doAs() calls will be blocked.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.benow.java.run.RestartableRunner |
|---|
org.benow.java.run.RestartableRunner.LoopWatcher |
| Field Summary |
|---|
| Fields inherited from class org.benow.java.run.RestartableRunner |
|---|
loopWatcher, running |
| Constructor Summary | |
|---|---|
SubjectThread()
Deprecated. |
|
SubjectThread(User user,
org.benow.java.run.MessyRunnable action)
Deprecated. |
|
| Method Summary | |
|---|---|
static void |
assertPermission(Permission perm)
Deprecated. Asserts the given permission on the current associated user. |
protected java.lang.Thread |
createThread()
Deprecated. Override default thread with thread which has reference to this SubjectThread (which is actually not a thread, but a runnable...). |
static SubjectThread |
currentThread()
Deprecated. |
void |
doAs(User user,
org.benow.java.run.MessyRunnable action)
Deprecated. Performs the given action as the given principal (Subject, User, Principal, etc). |
java.lang.Object |
doAs(User user,
org.benow.java.run.MessyRunnable action,
SubjectThreadListener listener)
Deprecated. |
java.lang.Object |
exec()
Deprecated. |
static User |
getCurrentUser()
Deprecated. |
User |
getUser()
Deprecated. |
static boolean |
hasPermission(Permission perm)
Deprecated. |
boolean |
runBody()
Deprecated. |
| Methods inherited from class org.benow.java.run.RestartableRunner |
|---|
die, disableRestartProtection, enableRestartProtect, getName, getThread, onRestartAbort, restart, restartBody, run, runInit, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SubjectThread(User user,
org.benow.java.run.MessyRunnable action)
public SubjectThread()
| Method Detail |
|---|
public void doAs(User user,
org.benow.java.run.MessyRunnable action)
throws java.lang.Throwable
user - action -
java.lang.Exception
java.lang.Throwablepublic User getUser()
public java.lang.Object exec()
throws java.lang.Throwable
java.lang.Throwable
public java.lang.Object doAs(User user,
org.benow.java.run.MessyRunnable action,
SubjectThreadListener listener)
throws java.lang.Throwable
java.lang.Throwablepublic static SubjectThread currentThread()
public static void assertPermission(Permission perm)
perm - permission to assertprotected java.lang.Thread createThread()
createThread in class org.benow.java.run.RestartableRunnerpublic final boolean runBody()
runBody in class org.benow.java.run.RestartableRunnerpublic static User getCurrentUser()
public static boolean hasPermission(Permission perm)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||