List of usage examples for org.apache.commons.jcs.engine CompositeCacheAttributes setDiskUsagePattern
@Override public void setDiskUsagePattern(DiskUsagePattern diskUsagePattern)
From source file:org.openstreetmap.josm.data.cache.JCSCacheManager.java
private static CompositeCacheAttributes getCacheAttributes(int maxMemoryElements) { CompositeCacheAttributes ret = new CompositeCacheAttributes(); ret.setMaxObjects(maxMemoryElements); ret.setDiskUsagePattern(DiskUsagePattern.UPDATE); return ret;/*from w ww .j a v a 2s . c om*/ }
From source file:org.openstreetmap.josm.plugins.openstreetcam.cache.CacheManager.java
private CacheManager() { final String pluginLocation = new File(Preferences.main().getPluginsDirectory(), GuiConfig.getInstance().getPluginShortName()).getPath(); final CacheSettings settings = PreferenceManager.getInstance().loadPreferenceSettings().getCacheSettings(); this.cache = JCSCacheManager.getCache(CACHE_NAME, settings.getMemoryCount(), settings.getDiskCount(), pluginLocation + CACHE_LOCATION); final CompositeCacheAttributes attr = (CompositeCacheAttributes) this.cache.getCacheAttributes(); attr.setDiskUsagePattern(DiskUsagePattern.SWAP); attr.setMemoryCacheName(MEMORY_MANAGER); attr.setUseMemoryShrinker(true);// www. j a va 2 s . co m this.cache.setCacheAttributes(attr); this.cache.clear(); }