KickJava   Java API By Example, From Geeks To Geeks.

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


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 ByteBuffer Object pool configuration.
19  * The xml is &lt;byte-buffer-object-pool&gt;...&lt;/byte-buffer-object-pool&gt;
20  * @author Akshathkumar Shetty
21  * @since 1.3
22  */

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

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