Example usage for org.apache.commons.jcs.utils.serialization StandardSerializer StandardSerializer

List of usage examples for org.apache.commons.jcs.utils.serialization StandardSerializer StandardSerializer

Introduction

In this page you can find the example usage for org.apache.commons.jcs.utils.serialization StandardSerializer StandardSerializer.

Prototype

StandardSerializer

Source Link

Usage

From source file:org.openstreetmap.josm.data.cache.JCSCacheManager.java

@SuppressWarnings("unchecked")
private static <K, V> CacheAccess<K, V> getCacheInner(String cacheName, int maxMemoryObjects,
        int maxDiskObjects, String cachePath) throws IOException {
    CompositeCache<K, V> cc = cacheManager.getCache(cacheName, getCacheAttributes(maxMemoryObjects));

    if (cachePath != null && cacheDirLock != null) {
        IDiskCacheAttributes diskAttributes = getDiskCacheAttributes(maxDiskObjects, cachePath, cacheName);
        try {/* www. j a v  a  2s.c o  m*/
            if (cc.getAuxCaches().length == 0) {
                cc.setAuxCaches(new AuxiliaryCache[] { DISK_CACHE_FACTORY.createCache(diskAttributes,
                        cacheManager, null, new StandardSerializer()) });
            }
        } catch (IOException e) {
            throw e;
        } catch (Exception e) { // NOPMD
            throw new IOException(e);
        }
    }
    return new CacheAccess<>(cc);
}