1 4 package com.tc.object.cache; 5 6 import com.tc.properties.TCProperties; 7 8 public class CacheConfigImpl implements CacheConfig { 9 10 private final int leastCount; 11 private final int percentageToEvict; 12 private final long sleepInterval; 13 private final int criticalThreshold; 14 private final int threshold; 15 private final boolean monitorOldGenOnly; 16 private final boolean loggingEnabled; 17 18 public CacheConfigImpl(TCProperties cacheManagerProperties) { 19 leastCount = cacheManagerProperties.getInt("leastCount"); 20 percentageToEvict = cacheManagerProperties.getInt("percentageToEvict"); 21 sleepInterval = cacheManagerProperties.getLong("sleepInterval"); 22 criticalThreshold = cacheManagerProperties.getInt("criticalThreshold"); 23 threshold = cacheManagerProperties.getInt("threshold"); 24 monitorOldGenOnly = cacheManagerProperties.getBoolean("monitorOldGenOnly"); 25 loggingEnabled = cacheManagerProperties.getBoolean("logging.enabled"); 26 } 27 28 public int getLeastCount() { 29 return leastCount; 30 } 31 32 public int getPercentageToEvict() { 33 return percentageToEvict; 34 } 35 36 public long getSleepInterval() { 37 return sleepInterval; 38 } 39 40 public int getUsedCriticalThreshold() { 41 return criticalThreshold; 42 } 43 44 public int getUsedThreshold() { 45 return threshold; 46 } 47 48 public boolean isOnlyOldGenMonitored() { 49 return monitorOldGenOnly; 50 } 51 52 public boolean isLoggingEnabled() { 53 return loggingEnabled; 54 } 55 56 } 57 | Popular Tags |