KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > scheduling > concurrent > CustomizableThreadFactory


1 /*
2  * Copyright 2002-2007 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.scheduling.concurrent;
18
19 import java.util.concurrent.ThreadFactory JavaDoc;
20
21 import org.springframework.util.CustomizableThreadCreator;
22
23 /**
24  * Implementation of the JDK 1.5 {@link java.util.concurrent.ThreadFactory}
25  * interface, allowing for customizing the created threads (name, priority, etc).
26  *
27  * <p>See the base class {@link org.springframework.util.CustomizableThreadCreator}
28  * for details on the available configuration options.
29  *
30  * @author Juergen Hoeller
31  * @since 2.0.3
32  * @see #setThreadNamePrefix
33  * @see #setThreadPriority
34  */

35 public class CustomizableThreadFactory extends CustomizableThreadCreator implements ThreadFactory JavaDoc {
36
37     /**
38      * Create a new CustomizableThreadFactory with default thread name prefix.
39      */

40     public CustomizableThreadFactory() {
41         super();
42     }
43
44     /**
45      * Create a new CustomizableThreadFactory with the given thread name prefix.
46      * @param threadNamePrefix the prefix to use for the names of newly created threads
47      */

48     public CustomizableThreadFactory(String JavaDoc threadNamePrefix) {
49         super(threadNamePrefix);
50     }
51
52
53     public Thread JavaDoc newThread(Runnable JavaDoc runnable) {
54         return createThread(runnable);
55     }
56
57 }
58
Popular Tags