KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
18  * This class encapsulate the Thread Object pool configuration.
19  * The xml is &lt;client-data-object-pool&gt;...&lt;/client-data-object-pool&gt;
20  * @author Akshathkumar Shetty
21  */

22 public class ClientDataObjectPoolConfig extends PoolConfig {
23
24     public ClientDataObjectPoolConfig() {
25         super();
26     }
27
28     public ClientDataObjectPoolConfig(PoolConfig poolConfig) {
29         setMaxActive(poolConfig.getMaxActive());
30         setMaxIdle(poolConfig.getMaxIdle());
31         setInitSize(poolConfig.getInitSize());
32     }
33
34     /**
35      * Returns XML config of this class.
36      */

37     public String JavaDoc toXML(String JavaDoc pad) {
38         if(pad==null) pad="";
39         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
40         sb.append(pad+"<client-data-object-pool>\n");
41         sb.append(pad+"\t<max-active>"+getMaxActive()+"</max-active>\n");
42         sb.append(pad+"\t<max-idle>"+getMaxIdle()+"</max-idle>\n");
43         sb.append(pad+"\t<init-size>"+getInitSize()+"</init-size>\n");
44         sb.append(pad+"</client-data-object-pool>\n");
45         return sb.toString();
46     }
47 }
48
Popular Tags