List of usage examples for org.apache.commons.jcs.engine.control CompositeCache setAuxCaches
public void setAuxCaches(AuxiliaryCache<K, V>[] auxCaches)
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 {/*from w w w.j a va 2 s . c om*/ 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); }