Changeset 8172 in josm


Ignore:
Timestamp:
2015-04-06T23:16:50+02:00 (4 years ago)
Author:
bastiK
Message:

see #11216 - fix IndexedDiskCacheManager (patch by wiktorn)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r8168 r8172  
    435435        -keep class org.w3._2001.xmlschema.Adapter1
    436436        -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
     437        -keep class org.apache.commons.logging.impl.*
    437438
    438439        -keepclassmembers enum  * {
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r8168 r8172  
    1515import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache;
    1616import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes;
    17 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheManager;
     17import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory;
    1818import org.apache.commons.jcs.engine.CompositeCacheAttributes;
    1919import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes.DiskUsagePattern;
     
    2828/**
    2929 * @author Wiktor Niesiobędzki
    30  * 
     30 *
    3131 * Wrapper class for JCS Cache. Sets some sane environment and returns instances of cache objects.
    3232 * Static configuration for now assumes some small LRU cache in memory and larger LRU cache on disk
     
    3939    private static long maxObjectTTL        = Long.MAX_VALUE;
    4040    private final static String PREFERENCE_PREFIX = "jcs.cache";
     41    private final static IndexedDiskCacheFactory diskCacheFactory = new IndexedDiskCacheFactory();
    4142
    4243    /**
     
    141142            IndexedDiskCacheAttributes diskAttributes = getDiskCacheAttributes(maxDiskObjects, cachePath);
    142143            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
    144146            cc.setAuxCaches(new AuxiliaryCache[]{diskCache});
    145147        }
Note: See TracChangeset for help on using the changeset viewer.