01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.thread;
18:
19: /**
20: * The ThreadFactory interface describes the responability of Factories
21: * creating Thread for {@link ThreadPool}s of the {@link RunnableManager}
22: *
23: * @author <a href="mailto:giacomo.at.apache.org">Giacomo Pati</a>
24: * @version CVS $Id: ThreadFactory.java 56765 2004-11-06 13:54:31Z giacomo $
25: */
26: public interface ThreadFactory extends
27: EDU.oswego.cs.dl.util.concurrent.ThreadFactory {
28: //~ Methods ----------------------------------------------------------------
29:
30: /**
31: * Set the daemon mode of created <code>Thread</code>s should have
32: *
33: * @param isDaemon Whether new {@link Thread}s should run as daemons.
34: */
35: void setDaemon(boolean isDaemon);
36:
37: /**
38: * Get the daemon mode created <code>Thread</code>s will have
39: *
40: * @return Whether new {@link Thread}s should run as daemons.
41: */
42: boolean isDaemon();
43:
44: /**
45: * Set the priority newly created <code>Thread</code>s should have
46: *
47: * @param priority One of {@link Thread#MIN_PRIORITY}, {@link
48: * Thread#NORM_PRIORITY}, {@link Thread#MAX_PRIORITY}
49: */
50: void setPriority(int priority);
51:
52: /**
53: * Get the priority newly created <code>Thread</code>s will have
54: *
55: * @return One of {@link Thread#MIN_PRIORITY}, {@link
56: * Thread#NORM_PRIORITY}, {@link Thread#MAX_PRIORITY}
57: */
58: int getPriority();
59:
60: /**
61: * Create a new Thread for a {@link Runnable} command
62: *
63: * @param command The <code>Runnable</code>
64: *
65: * @return new <code>Thread</code>
66: */
67: Thread newThread(Runnable command);
68: }
|