1 *java.util.concurrent.ThreadFactory* *ThreadFactory* An object that creates new
3 public interface interface ThreadFactory
6 |java.util.concurrent.ThreadFactory_Description|
7 |java.util.concurrent.ThreadFactory_Fields|
8 |java.util.concurrent.ThreadFactory_Constructors|
9 |java.util.concurrent.ThreadFactory_Methods|
11 ================================================================================
13 *java.util.concurrent.ThreadFactory_Methods*
14 |java.util.concurrent.ThreadFactory.newThread(Runnable)|Constructs a newThread.
16 *java.util.concurrent.ThreadFactory_Description*
18 An object that creates new threads on demand. Using thread factories removes
19 hardwiring of calls to new Thread(|java.lang.Thread|) , enabling applications
20 to use special thread subclasses, priorities, etc.
22 The simplest implementation of this interface is just:
24 class SimpleThreadFactory implements ThreadFactory { public Thread
25 newThread(Runnable r) { return new Thread(r); } }
27 The (|java.util.concurrent.Executors|) method provides a more useful simple
28 implementation, that sets the created thread context to known values before
33 *java.util.concurrent.ThreadFactory.newThread(Runnable)*
35 public |java.lang.Thread| newThread(java.lang.Runnable r)
37 Constructs a newThread. Implementations may also initialize priority, name,
38 daemon status,ThreadGroup, etc.
41 r - a runnable to be executed by new thread instance
43 Returns: constructed thread, or {@code null} if the request to create a thread is