1 |
tim |
1.1 |
/* |
2 |
|
|
* @(#)ThreadFactory.java |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
package java.util.concurrent; |
6 |
|
|
|
7 |
|
|
/** |
8 |
|
|
* An object that creates new threads on demand. Using thread factories |
9 |
|
|
* removes hardwiring of calls to {@link Thread#Thread(Runnable) new Thread}, |
10 |
|
|
* enabling applications to use special thread subclasses, priorities, etc. |
11 |
|
|
* |
12 |
|
|
* @since 1.5 |
13 |
|
|
* |
14 |
|
|
* @spec JSR-166 |
15 |
|
|
* @revised $Date: 2003/02/26 10:48:09 $ |
16 |
|
|
* @editor $Author: jozart $ |
17 |
|
|
*/ |
18 |
|
|
public interface ThreadFactory { |
19 |
|
|
|
20 |
|
|
/** |
21 |
|
|
* Constructs a new <tt>Thread</tt>. Implementations may also initialize |
22 |
|
|
* priority, name, daemon status, <tt>ThreadGroup</tt>, etc. |
23 |
|
|
* |
24 |
|
|
* @param r a runnable to be executed by new thread instance |
25 |
|
|
* @return constructed thread |
26 |
|
|
*/ |
27 |
|
|
Thread newThread(Runnable r); |
28 |
|
|
} |