1 |
/* |
2 |
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
* Expert Group and released to the public domain. Use, modify, and |
4 |
* redistribute this code in any way without acknowledgement. |
5 |
*/ |
6 |
|
7 |
package java.util.concurrent; |
8 |
|
9 |
/** |
10 |
* An object that creates new threads on demand. Using thread factories |
11 |
* removes hardwiring of calls to {@link Thread#Thread(Runnable) new Thread}, |
12 |
* enabling applications to use special thread subclasses, priorities, etc. |
13 |
* |
14 |
* @since 1.5 |
15 |
* @author Doug Lea |
16 |
*/ |
17 |
public interface ThreadFactory { |
18 |
|
19 |
/** |
20 |
* Constructs a new <tt>Thread</tt>. Implementations may also initialize |
21 |
* priority, name, daemon status, <tt>ThreadGroup</tt>, etc. |
22 |
* |
23 |
* @param r a runnable to be executed by new thread instance |
24 |
* @return constructed thread |
25 |
*/ |
26 |
Thread newThread(Runnable r); |
27 |
} |