KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > util > xmlreader > DBObjectPoolConfig


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.util.xmlreader;
16
17 import java.util.*;
18 /**
19  * This class encapsulate the database object pool.
20  * The xml is &lt;db-object-pool&gt;...&lt;/db-object-pool&gt;.
21  * @author Akshathkumar Shetty
22  * @since 1.3
23  */

24 public class DBObjectPoolConfig implements java.io.Serializable JavaDoc {
25     private DatabaseConnectionSet databaseConnectionSet;
26     private String JavaDoc dbPoolUtil;
27
28     /**
29      * Returns the DatabaseConnectionSet.
30      * @return DatabaseConnectionSet
31      */

32     public DatabaseConnectionSet getDatabaseConnectionSet() {
33         return databaseConnectionSet;
34     }
35     /**
36      * Sets the DatabaseConnectionSet.
37      * XML Tag: &lt;database-connection-set&gt;&lt;/database-connection-set&gt;
38      * @param databaseConnectionSet
39      */

40     public void setDatabaseConnectionSet(DatabaseConnectionSet databaseConnectionSet) {
41         this.databaseConnectionSet = databaseConnectionSet;
42     }
43
44     /**
45      * Sets the {@link org.quickserver.sql.DBPoolUtil} class that handles the
46      * database connection pools.
47      * XML Tag: &lt;db-pool-util&gt;&lt;/db-pool-util&gt;
48      * @param className the fully qualified name of the class
49      * that implements {@link org.quickserver.sql.DBPoolUtil}.
50      * @see #getDbPoolUtil
51      */

52     public void setDbPoolUtil(String JavaDoc className) {
53         dbPoolUtil = className;
54     }
55     /**
56      * Returns the {@link org.quickserver.sql.DBPoolUtil} class that handles the
57      * database connection pools.
58      * @see #setDbPoolUtil
59      */

60     public String JavaDoc getDbPoolUtil() {
61         return dbPoolUtil;
62     }
63
64     /**
65      * Returns XML config of this class.
66      * @since 1.3
67      */

68     public String JavaDoc toXML(String JavaDoc pad) {
69         if(pad==null) pad="";
70         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
71
72         sb.append(pad+"<db-object-pool>\n");
73         if(getDatabaseConnectionSet()!=null)
74             sb.append(getDatabaseConnectionSet().toXML(pad+"\t"));
75         sb.append(pad+"\t<db-pool-util>"+getDbPoolUtil()+"</db-pool-util>\n");
76         sb.append(pad+"</db-object-pool>\n");
77         return sb.toString();
78     }
79 }
80
Popular Tags