com.sun.sgs.impl.util
Class NamedThreadFactory
java.lang.Object
com.sun.sgs.impl.util.NamedThreadFactory
- All Implemented Interfaces:
- ThreadFactory
public class NamedThreadFactory
- extends Object
- implements ThreadFactory
A custom implementation of a ThreadFactory that assigns a
configurable name to each thread.
|
Constructor Summary |
NamedThreadFactory(String name)
Creates a new NamedThreadFactory that names each thread that
it creates using the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedThreadFactory
public NamedThreadFactory(String name)
- Creates a new
NamedThreadFactory that names each thread that
it creates using the given name.
- Parameters:
name - the prefix to use for each thread's name
newThread
public Thread newThread(Runnable r)
- Constructs a new
Thread for the given Runnable. The
name of the returned Thread is equal to the current count of the
number of threads that have been created thus far with this factory
appended to the name used to construct this factory.
- Specified by:
newThread in interface ThreadFactory
- Parameters:
r - the Runnable to be executed by the new thread
- Returns:
- new thread associated with the given
Runnable
Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved