01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.utils;
07:
08: /**
09: * Basic resource limits
10: * Limits include : hard upper/lower limits, desired size,
11: * activeLimit, update time and prune factor.
12: * @author Peter Kharchenko {@link <a href="mailto:pkharchenko@interactivebusiness.com">pkharchenko@interactivebusiness.com</a>}
13: * @version $Revision: 36690 $
14: */
15: public class ResourceLimits {
16: protected int maxSize = -1;
17: protected int minSize = 0;
18: protected int optimalSize = 1;
19:
20: protected int maxActiveSize = -1;
21:
22: protected int updateTime = 10000; // 10 seconds
23: protected float pruneFactor = 0.1F; // 10 percent
24:
25: public ResourceLimits() {
26: }
27:
28: public int getMaxSize() {
29: return maxSize;
30: }
31:
32: public int getMinSize() {
33: return minSize;
34: }
35:
36: public int getOptimalSize() {
37: return optimalSize;
38: }
39:
40: public float getPruneFactor() {
41: return pruneFactor;
42: }
43:
44: public int getUpdateTime() {
45: return updateTime;
46: }
47:
48: public void setUpdateTime(int updateTime) {
49: this .updateTime = updateTime;
50: }
51:
52: public void setPruneFactor(float pruneFactor) {
53: this .pruneFactor = pruneFactor;
54: }
55:
56: public void setOptimalSize(int optimalSize) {
57: this .optimalSize = optimalSize;
58: }
59:
60: public void setMinSize(int minSize) {
61: this .minSize = minSize;
62: }
63:
64: public void setMaxSize(int maxSize) {
65: this .maxSize = maxSize;
66: }
67:
68: public int getMaxActiveSize() {
69: return maxActiveSize;
70: }
71:
72: public void setMaxActiveSize(int maxActiveSize) {
73: this.maxActiveSize = maxActiveSize;
74: }
75: }
|