KickJava   Java API By Example, From Geeks To Geeks.

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


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 ClientHandler Object pool configuration.
19  * The xml is &lt;client-handler-object-pool&gt;...&lt;/client-handler-object-pool&gt;
20  * @author Akshathkumar Shetty
21  */

22 public class ClientHandlerObjectPoolConfig extends PoolConfig {
23
24     public ClientHandlerObjectPoolConfig() {
25         super();
26     }
27
28     public ClientHandlerObjectPoolConfig(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-handler-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-handler-object-pool>\n");
45         return sb.toString();
46     }
47 }
48
Popular Tags