|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.common.util.concurrent.NamingThreadFactory
ThreadFactoryBuilder
and then use its
ThreadFactoryBuilder.setNameFormat(java.lang.String)
and
ThreadFactoryBuilder.setThreadFactory(java.util.concurrent.ThreadFactory)
methods.
@Beta @Deprecated public final class NamingThreadFactory
A ThreadFactory which decorates another ThreadFactory to set a name on each thread created.
Constructor Summary | |
---|---|
NamingThreadFactory(String format)
Deprecated. Creates a new factory that delegates to the default thread factory for thread creation, then uses format to construct a name for the new
thread. |
|
NamingThreadFactory(String format,
ThreadFactory backingFactory)
Deprecated. Creates a new factory that delegates to backingFactory for thread
creation, then uses format to construct a name for the new thread. |
Method Summary | |
---|---|
Thread |
newThread(Runnable r)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamingThreadFactory(String format)
format
to construct a name for the new
thread.
format
- a String.format(String, Object...)
-compatible format
String, to which a unique integer (0, 1, etc.) will be supplied as the
single parameter. This integer will be unique to this instance of
NamingThreadFactory and will be assigned sequentially.public NamingThreadFactory(String format, ThreadFactory backingFactory)
backingFactory
for thread
creation, then uses format
to construct a name for the new thread.
format
- a String.format(String, Object...)
-compatible format
String, to which a unique integer (0, 1, etc.) will be supplied as the
single parameterbackingFactory
- the factory that will actually create the threads
IllegalFormatException
- if format
is invalidMethod Detail |
---|
public Thread newThread(Runnable r)
newThread
in interface ThreadFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |