|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.util.concurrent.ExecutorUtils.SafeThreadFactory
Thread factory implementation that attempts to ensure that created threads
are equivalent regardless of threads that request creation. Precisely,
created threads belong to the same thread group, and they inherit a
"parent thread context" (access control context,
DelegatableThreadLocal
s, etc.) from the factory creator rather than
from the invoker of newThread(java.lang.Runnable)
.
When used with ThreadPoolExecutor
, is ensures
deterministic behavior and consistent security properties.
Nevertheless, stronger semantics are often neccessary in
security-sensitive applications. In particular,
it may be required that worker tasks run within access control context and
with delegatable locals of the thread that scheduled the task, which
may generally be distinct from both the thread pool creator and the worker
thread creator. If such security semantics is needed, use
SecureThreadPoolExecutor
.
Constructor Summary | |
ExecutorUtils.SafeThreadFactory()
Creates a new tread factory that creates threads within a default thread group. |
|
ExecutorUtils.SafeThreadFactory(java.lang.String name)
Creates a new tread factory that uses default thread group and specified thread name prefix. |
|
ExecutorUtils.SafeThreadFactory(java.lang.ThreadGroup group)
Creates a new tread factory that creates threads within the specified thread group. |
|
ExecutorUtils.SafeThreadFactory(java.lang.ThreadGroup group,
java.lang.String name)
Creates a new tread factory that creates threads within the specified thread group, and uses specified thread name prefix, appending consecutive numbers to the names of created threads. |
|
ExecutorUtils.SafeThreadFactory(java.lang.ThreadGroup group,
java.lang.String name,
boolean count)
Creates a new tread factory that creates threads within the specified thread group, and uses specified thread name prefix. |
Method Summary | |
java.lang.Thread |
newThread(java.lang.Runnable command)
Constructs a new Thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExecutorUtils.SafeThreadFactory()
public ExecutorUtils.SafeThreadFactory(java.lang.String name)
name
- the thread name prefixpublic ExecutorUtils.SafeThreadFactory(java.lang.ThreadGroup group)
group
- the thread group for created threadspublic ExecutorUtils.SafeThreadFactory(java.lang.ThreadGroup group, java.lang.String name)
group
- the thread group for created threadsname
- the thread name prefixpublic ExecutorUtils.SafeThreadFactory(java.lang.ThreadGroup group, java.lang.String name, boolean count)
group
- the thread group for created threadsname
- the thread name prefixMethod Detail |
public java.lang.Thread newThread(java.lang.Runnable command)
ThreadFactory
newThread
in interface ThreadFactory
command
- a runnable to be executed by new thread instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |