org.marketcetera.util.misc
Class NamedThreadFactory
java.lang.Object
org.marketcetera.util.misc.NamedThreadFactory
- All Implemented Interfaces:
- ThreadFactory
public class NamedThreadFactory
- extends Object
- implements ThreadFactory
A Thread factory that creates threads whose names begin with a specified
prefix. If the specified prefix is foo, the threads created
by this factory will have names that look like fooX where
'X' is a monotonically increasing number used to name each thread created
by this factory uniquely.
The factory delegates the thread creation to
Executors.defaultThreadFactory(). After the
thread has been created by the delegated factory, this class simply
resets their name to the desired value.
- Since:
- 2.0.0
- Version:
- $Id: NamedThreadFactory.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- anshul@marketcetera.com
|
Constructor Summary |
NamedThreadFactory(String inNamePrefix)
Creates an instance that will create threads whose names begin with
the specified prefix. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedThreadFactory
public NamedThreadFactory(String inNamePrefix)
- Creates an instance that will create threads whose names begin with
the specified prefix.
- Parameters:
inNamePrefix - the prefix to use for naming every thread
created by this factory. Cannot be null.
newThread
public Thread newThread(Runnable r)
- Specified by:
newThread in interface ThreadFactory
Copyright © 2012. All Rights Reserved.