01: /*
02: * This file is part of the QuickServer library
03: * Copyright (C) 2003-2005 QuickServer.org
04: *
05: * Use, modification, copying and distribution of this software is subject to
06: * the terms and conditions of the GNU Lesser General Public License.
07: * You should have received a copy of the GNU LGP License along with this
08: * library; if not, you can download a copy from <http://www.quickserver.org/>.
09: *
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 <byte-buffer-object-pool>...</byte-buffer-object-pool>
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 toXML(String pad) {
39: if (pad == null)
40: pad = "";
41: StringBuffer sb = new StringBuffer();
42: sb.append(pad + "<byte-buffer-object-pool>\n");
43: sb.append(pad + "\t<max-active>" + getMaxActive()
44: + "</max-active>\n");
45: sb
46: .append(pad + "\t<max-idle>" + getMaxIdle()
47: + "</max-idle>\n");
48: sb.append(pad + "\t<init-size>" + getInitSize()
49: + "</init-size>\n");
50: sb.append(pad + "</byte-buffer-object-pool>\n");
51: return sb.toString();
52: }
53: }
|