Changeset 8172 in josm for trunk/src


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

see #11216 - fix IndexedDiskCacheManager (patch by wiktorn)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.