com.google.common.util.concurrent
Class NamingThreadFactory

java.lang.Object
  extended by com.google.common.util.concurrent.NamingThreadFactory
All Implemented Interfaces:
ThreadFactory

Deprecated. Create a ThreadFactoryBuilder and then use its ThreadFactoryBuilder.setNameFormat(java.lang.String) and ThreadFactoryBuilder.setThreadFactory(java.util.concurrent.ThreadFactory) methods.

@Beta
@Deprecated
public final class NamingThreadFactory
extends Object
implements ThreadFactory

A ThreadFactory which decorates another ThreadFactory to set a name on each thread created.

Since:
1
Author:
Kevin Bourrillion

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

NamingThreadFactory

public 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.

Parameters:
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.

NamingThreadFactory

public 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.

Parameters:
format - a String.format(String, Object...)-compatible format String, to which a unique integer (0, 1, etc.) will be supplied as the single parameter
backingFactory - the factory that will actually create the threads
Throws:
IllegalFormatException - if format is invalid
Method Detail

newThread

public Thread newThread(Runnable r)
Deprecated. 
Specified by:
newThread in interface ThreadFactory