KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > rmi > jrmp > server > JUnicastThreadFactory


1 /**
2  * Copyright (C) 2002,2004 - INRIA (www.inria.fr)
3  *
4  * CAROL: Common Architecture for RMI ObjectWeb Layer
5  *
6  * This library is developed inside the ObjectWeb Consortium,
7  * http://www.objectweb.org
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  * USA
23  *
24  * --------------------------------------------------------------------------
25  * $Id: JUnicastThreadFactory.java,v 1.2 2004/09/01 11:02:41 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.rmi.jrmp.server;
29
30 //java import
31
import java.io.IOException JavaDoc;
32
33 /**
34  * Generic interface for getting threads, modeled after Enhydra
35  * ThreadClientService interface. This allows the com.lutris.eas.rmi.server code
36  * to be portable across app servers.
37  */

38 public interface JUnicastThreadFactory {
39
40     /**
41      * Get a thread for the client. This thread will belong to the client's
42      * thread group.
43      * @param target the Runnable object that will use this thread.
44      * @return the Thread that the client can now use.
45      */

46     public Thread JavaDoc getThread(Runnable JavaDoc target) throws IOException JavaDoc;
47
48     /**
49      * Get a thread for the client. This thread will belong to the client's
50      * thread group.
51      * @param target the Runnable object that will use this thread.
52      * @param name the name of the thread. If a <code>null<code> value is given
53      * an arbitrary name will be provided
54      * @return
55      * the Thread that the client can now use.
56      */

57     public Thread JavaDoc getThread(Runnable JavaDoc target, String JavaDoc name) throws IOException JavaDoc;
58
59     /**
60      * Get a thread for the client. This thread will belong to the the specified
61      * thread group, or the client's thread group if none is specified.
62      * @param group the ThreadGroup to which the new thread will be added. If
63      * <code>null</code> the new thread is added to the same thread
64      * group as the currently executing thread.
65      * @param target the Runnable object that will use this thread.
66      * @return the Thread that the client can now use.
67      */

68     public Thread JavaDoc getThread(ThreadGroup JavaDoc group, Runnable JavaDoc target) throws IOException JavaDoc;
69
70     /**
71      * Get a thread for the client. This thread will belong to the the specified
72      * thread group, or the client's thread group if none is specified.
73      * @param group the ThreadGroup to which the new thread will be added. If
74      * <code>null</code> the new thread is added to the same thread
75      * group as the currently executing thread.
76      * @param target the Runnable object that will use this thread.
77      * @param name the String name ofthe new thread. If a <code>null</code>
78      * value is given an arbitrary name will be provided.
79      * @return the Thread that the client can now use.
80      */

81     public Thread JavaDoc getThread(ThreadGroup JavaDoc group, Runnable JavaDoc target, String JavaDoc name) throws IOException JavaDoc;
82 }
Popular Tags