private static CacheConfiguration cacheConfiguration(String cacheName) { return new CacheConfiguration(cacheName, 1024) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU) .overflowToDisk(false) .diskPersistent(false); }
private static CacheConfiguration cacheConfiguration(String cacheName) { return new CacheConfiguration(cacheName, 1024) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU) .overflowToDisk(false) .diskPersistent(false); }
private synchronized Cache getHeap() { if (heap == null) { if (CacheManager.getInstance().cacheExists("hydrated-cache")) { heap = CacheManager.getInstance().getCache("hydrated-cache"); } else { CacheConfiguration config = new CacheConfiguration("hydrated-cache", 0).eternal(true).overflowToDisk(false).maxElementsInMemory(100000); Cache cache = new Cache(config); CacheManager.create().addCache(cache); heap = cache; } } return heap; }
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
public EHCacheTokenStore(String key, Bus b, URL configFileURL) { bus = b; if (bus != null) { b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this); } cacheManager = EHCacheUtils.getCacheManager(bus, configFileURL); // Cannot overflow to disk as SecurityToken Elements can't be serialized @SuppressWarnings("deprecation") CacheConfiguration cc = EHCacheManagerHolder.getCacheConfiguration(key, cacheManager) .overflowToDisk(false); //tokens not writable Cache newCache = new RefCountCache(cc); cache = cacheManager.addCacheIfAbsent(newCache); synchronized (cache) { if (cache.getStatus() != Status.STATUS_ALIVE) { cache = cacheManager.addCacheIfAbsent(newCache); } if (cache instanceof RefCountCache) { ((RefCountCache)cache).incrementAndGet(); } } // Set the TimeToLive value from the CacheConfiguration ttl = cc.getTimeToLiveSeconds(); }
public EHCacheTokenStore(String key, Bus b, URL configFileURL) { bus = b; if (bus != null) { b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this); } cacheManager = EHCacheUtils.getCacheManager(bus, configFileURL); // Cannot overflow to disk as SecurityToken Elements can't be serialized @SuppressWarnings("deprecation") CacheConfiguration cc = EHCacheManagerHolder.getCacheConfiguration(key, cacheManager) .overflowToDisk(false); //tokens not writable Cache newCache = new RefCountCache(cc); cache = cacheManager.addCacheIfAbsent(newCache); synchronized (cache) { if (cache.getStatus() != Status.STATUS_ALIVE) { cache = cacheManager.addCacheIfAbsent(newCache); } if (cache instanceof RefCountCache) { ((RefCountCache)cache).incrementAndGet(); } } // Set the TimeToLive value from the CacheConfiguration ttl = cc.getTimeToLiveSeconds(); }
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
ehCacheConfig.setName(cacheName); CacheConfiguration defaultCache = new CacheConfiguration(cacheName, 1).eternal(false).timeToIdleSeconds(30) .timeToLiveSeconds(30).overflowToDisk(false); ehCacheConfig.addDefaultCache(defaultCache); cacheManager = new CacheManager(ehCacheConfig);
.timeToLiveSeconds(30).overflowToDisk(false); ehCacheConfig.addDefaultCache(defaultCache); CacheService cacheService = new CacheService(new CacheManager(ehCacheConfig));
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
getDiskExpiryThreadIntervalSeconds() ).overflowToOffHeap( isOverflowToOffHeap() ).maxEntriesLocalDisk( getMaxElementsOnDisk() ).diskPersistent( isDiskPersistent() ).overflowToDisk( overflowToDisk );
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds)