KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jdbc > core > JdbcThreadFactory


1 /*
2  * XAPool: Open Source XA JDBC Pool
3  * Copyright (C) 2003 Objectweb.org
4  * Initial Developer: Lutris Technologies Inc.
5  * Contact: xapool-public@lists.debian-sf.objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  */

22 package org.enhydra.jdbc.core;
23
24 import java.sql.SQLException JavaDoc;
25
26 /**
27  * Generic interface for getting threads, modeled after Enhydra
28  * ThreadClientService interface. This allows the JdbcLib code
29  * to be portable across app servers.
30  */

31 public interface JdbcThreadFactory {
32
33     /**
34      * Get a thread for the client. This thread will belong to the
35      * client's thread group.
36      *
37      * @param target
38      * the Runnable object that will use this thread.
39      * @return
40      * the Thread that the client can now use.
41      */

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

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

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

92     public Thread JavaDoc getThread(ThreadGroup JavaDoc group, Runnable JavaDoc target, String JavaDoc name)
93         throws SQLException JavaDoc;
94 }
95
Popular Tags