01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.object.cache;
06:
07: import com.tc.properties.TCProperties;
08:
09: public class CacheConfigImpl implements CacheConfig {
10:
11: private final int leastCount;
12: private final int percentageToEvict;
13: private final long sleepInterval;
14: private final int criticalThreshold;
15: private final int threshold;
16: private final boolean monitorOldGenOnly;
17: private final boolean loggingEnabled;
18: private final int criticalObjectThreshold;
19:
20: public CacheConfigImpl(TCProperties cacheManagerProperties) {
21: leastCount = cacheManagerProperties.getInt("leastCount");
22: percentageToEvict = cacheManagerProperties
23: .getInt("percentageToEvict");
24: sleepInterval = cacheManagerProperties.getLong("sleepInterval");
25: criticalThreshold = cacheManagerProperties
26: .getInt("criticalThreshold");
27: threshold = cacheManagerProperties.getInt("threshold");
28: monitorOldGenOnly = cacheManagerProperties
29: .getBoolean("monitorOldGenOnly");
30: loggingEnabled = cacheManagerProperties
31: .getBoolean("logging.enabled");
32: criticalObjectThreshold = cacheManagerProperties
33: .getInt("criticalObjectThreshold");
34: }
35:
36: public int getLeastCount() {
37: return leastCount;
38: }
39:
40: public int getPercentageToEvict() {
41: return percentageToEvict;
42: }
43:
44: public long getSleepInterval() {
45: return sleepInterval;
46: }
47:
48: public int getUsedCriticalThreshold() {
49: return criticalThreshold;
50: }
51:
52: public int getUsedThreshold() {
53: return threshold;
54: }
55:
56: public boolean isOnlyOldGenMonitored() {
57: return monitorOldGenOnly;
58: }
59:
60: public boolean isLoggingEnabled() {
61: return loggingEnabled;
62: }
63:
64: public int getObjectCountCriticalThreshold() {
65: return criticalObjectThreshold;
66: }
67:
68: }
|