Ticket #11216: fix_IndexedDiskCacheManager.patch
File fix_IndexedDiskCacheManager.patch, 2.6 KB (added by , 9 years ago) |
---|
-
build.xml
434 434 -keep class * extends org.openstreetmap.josm.io.FileExporter 435 435 -keep class org.w3._2001.xmlschema.Adapter1 436 436 -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never 437 -keep class org.apache.commons.logging.impl.* 437 438 438 439 -keepclassmembers enum * { 439 440 public static **[] values(); -
src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
14 14 import org.apache.commons.jcs.auxiliary.AuxiliaryCache; 15 15 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache; 16 16 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes; 17 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache Manager;17 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory; 18 18 import org.apache.commons.jcs.engine.CompositeCacheAttributes; 19 19 import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes.DiskUsagePattern; 20 20 import org.apache.commons.jcs.engine.control.CompositeCache; … … 27 27 28 28 /** 29 29 * @author Wiktor Niesiobędzki 30 * 30 * 31 31 * Wrapper class for JCS Cache. Sets some sane environment and returns instances of cache objects. 32 32 * Static configuration for now assumes some small LRU cache in memory and larger LRU cache on disk 33 33 * … … 38 38 private static volatile CompositeCacheManager cacheManager = null; 39 39 private static long maxObjectTTL = Long.MAX_VALUE; 40 40 private final static String PREFERENCE_PREFIX = "jcs.cache"; 41 private final static IndexedDiskCacheFactory diskCacheFactory = new IndexedDiskCacheFactory(); 41 42 42 43 /** 43 44 * default objects to be held in memory by JCS caches (per region) … … 140 141 if (cachePath != null) { 141 142 IndexedDiskCacheAttributes diskAttributes = getDiskCacheAttributes(maxDiskObjects, cachePath); 142 143 diskAttributes.setCacheName(cacheName); 143 IndexedDiskCache<K, V> diskCache = IndexedDiskCacheManager.getInstance(null, null, new StandardSerializer()).getCache(diskAttributes); 144 IndexedDiskCache<K, V> diskCache = diskCacheFactory.createCache(diskAttributes, cacheManager, null, new StandardSerializer()); 145 144 146 cc.setAuxCaches(new AuxiliaryCache[]{diskCache}); 145 147 } 146 148 return new CacheAccess<K, V>(cc);