public class AssociatedThread extends ContextAwareThread
WARNING: Be very careful using this mechanism. Much (if not all of) the context-local data may not be thread-safe. Any data sharing between threads sharing a context must be made safe by the caller.
Modifier and Type | Field and Description |
---|---|
private SecurityContext |
context
Any pending security context switch or
null . |
sm, stack
Constructor and Description |
---|
AssociatedThread(java.lang.Runnable core)
Constructor which allows the core logic to be specified.
|
Modifier and Type | Method and Description |
---|---|
void |
morphContextIfNeeded()
Switch security contexts on the current thread if a switch is pending.
|
void |
setPendingContextSwitch(java.lang.Object context)
Save the given context as a pending context switch which will be
processed later by the key reading thread.
|
needsSession, run
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private SecurityContext context
null
.public AssociatedThread(java.lang.Runnable core) throws java.lang.NullPointerException
core
- The logic to execute when the thread is started. Must not be null
.java.lang.NullPointerException
- If the instantiating thread has no security context or if core
is
null
.public void setPendingContextSwitch(java.lang.Object context)
context
- The security context to switch to (if non-null).public void morphContextIfNeeded()