org.webbitserver.helpers
Class NamingThreadFactory
java.lang.Object
org.webbitserver.helpers.NamingThreadFactory
- All Implemented Interfaces:
- ThreadFactory
public class NamingThreadFactory
- extends Object
- implements ThreadFactory
Wraps a ThreadFactory and assigns a name to each newly created thread, that includes two
counters: one to indicate which ThreadFactory instance this is, and another for the thread
created by the factory.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamingThreadFactory
public NamingThreadFactory(ThreadFactory factory,
String prefix)
NamingThreadFactory
public NamingThreadFactory(String prefix)
newThread
public Thread newThread(Runnable r)
- Specified by:
newThread in interface ThreadFactory
threadName
protected String threadName()
- Override this method to customize thread name.
Copyright © 2013. All Rights Reserved.