public class NamingThreadFactory extends Object implements ThreadFactory
Modifier and Type | Field and Description |
---|---|
private static AtomicInteger |
IDENTIFIERS
Unique identifier generator.
|
private int |
m_identifier
Pool identifier.
|
private ThreadFactory |
m_threadFactory
The wrapped thread factory on which creation is delegated.
|
private AtomicInteger |
threadNumber
Per-factory counter
|
Modifier | Constructor and Description |
---|---|
|
NamingThreadFactory(ThreadFactory threadFactory)
Creates the object delegating to the given thread factory.
|
private |
NamingThreadFactory(ThreadFactory threadFactory,
int identifier)
Creates the object delegating to the given thread factory.
|
Modifier and Type | Method and Description |
---|---|
Thread |
newThread(Runnable r)
Creates a new thread.
|
static void |
reset()
For test only.
|
private static final AtomicInteger IDENTIFIERS
private final AtomicInteger threadNumber
private final ThreadFactory m_threadFactory
private final int m_identifier
public NamingThreadFactory(ThreadFactory threadFactory)
threadFactory
- the thread factoryprivate NamingThreadFactory(ThreadFactory threadFactory, int identifier)
threadFactory
- the thread factoryidentifier
- the pool identifierCopyright © 2014. All rights reserved.