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 pool configuration.
19: * @author Akshathkumar Shetty
20: * @since 1.4.5
21: */
22: public class PoolConfig implements java.io.Serializable {
23: private int maxActive = -1;
24: private int maxIdle = 50;
25: private int initSize = 25;
26:
27: /**
28: * Returns the inital size of the pool.
29: * @see #setInitSize
30: * @since 1.4.6
31: */
32: public int getInitSize() {
33: if (maxIdle != -1 && initSize > maxIdle)
34: return maxIdle;
35: else
36: return initSize;
37: }
38:
39: /**
40: * Sets the inital size of the pool.
41: * XML Tag: <init-size></init-size>
42: * @param initSize inital size of the pool.
43: * @see #getInitSize
44: * @since 1.4.6
45: */
46: public void setInitSize(int initSize) {
47: this .initSize = initSize;
48: }
49:
50: /**
51: * Returns the maximum active objects allowed in the pool.
52: * @see #setMaxActive
53: */
54: public int getMaxActive() {
55: return maxActive;
56: }
57:
58: /**
59: * Sets the maximum active objects allowed in the pool.
60: * XML Tag: <max-activ></max-activ>
61: * @param maxActive maximum allowed active objects
62: * @see #getMaxActive
63: */
64: public void setMaxActive(int maxActive) {
65: this .maxActive = maxActive;
66: }
67:
68: /**
69: * Returns the maximum idle objects allowed in the pool.
70: * @see #setMaxIdle
71: */
72: public int getMaxIdle() {
73: return maxIdle;
74: }
75:
76: /**
77: * Sets the maximum Idle objects allowed in the pool.
78: * XML Tag: <max-idle></max-idle>
79: * @param maxIdle maximum allowed active objects
80: * @see #getMaxIdle
81: */
82: public void setMaxIdle(int maxIdle) {
83: this.maxIdle = maxIdle;
84: }
85: }
|