long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); if (cacheLoaderTimeoutMillis > 0) { try {
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); final Object value; if (cacheLoaderTimeoutMillis > 0) {
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); if (cacheLoaderTimeoutMillis > 0) { try {
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); if (cacheLoaderTimeoutMillis > 0) { try {
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); if (cacheLoaderTimeoutMillis > 0) { try {
/** * Replace the cache with a BlockingCache decorated one if this has not been done yet. * The cacheLoaderTimeoutMillis of the original cache will be used as the timeoutMillis of the BlockingCache. * @param ehcache the original cache * @return a BlockingCache wrapping the original one */ protected BlockingCache replaceWithBlockingCacheIfNot(Ehcache ehcache){ if (ehcache instanceof BlockingCache){ return (BlockingCache) ehcache; } BlockingCache blockingCache = new BlockingCache(ehcache); blockingCache.setTimeoutMillis((int)ehcache.getCacheConfiguration().getCacheLoaderTimeoutMillis()); cacheManager.replaceCacheWithDecoratedCache(ehcache, blockingCache); return blockingCache; }
/** * Replace the cache with a SelfPopulatingCache decorated one if this has not been done yet. * The cacheLoaderTimeoutMillis of the original cache will be used as the timeoutMillis of the BlockingCache. * @param ehcache the original cache * @param factory the cache entry value factory * @return a BlockingCache wrapping the original one */ protected SelfPopulatingCache replaceWithSelfPopulatingCacheIfNot(Ehcache ehcache, CacheEntryFactory factory){ if (ehcache instanceof SelfPopulatingCache){ return (SelfPopulatingCache) ehcache; } SelfPopulatingCache selfPopulatingCache = new SelfPopulatingCache(ehcache, factory); selfPopulatingCache.setTimeoutMillis((int)ehcache.getCacheConfiguration().getCacheLoaderTimeoutMillis()); cacheManager.replaceCacheWithDecoratedCache(ehcache, selfPopulatingCache); return selfPopulatingCache; }
element.addAttribute(new SimpleNodeAttribute("overflowToOffHeap", cacheConfiguration.isOverflowToOffHeap())); element.addAttribute(new SimpleNodeAttribute("cacheLoaderTimeoutMillis", cacheConfiguration.getCacheLoaderTimeoutMillis()) .optional(true).defaultValue(0L)); element.addAttribute(new SimpleNodeAttribute("transactionalMode", cacheConfiguration.getTransactionalMode()).optional(true)
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); final Object value; if (cacheLoaderTimeoutMillis > 0) {
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); final Object value; if (cacheLoaderTimeoutMillis > 0) {
long cacheLoaderTimeoutMillis = configuration.getCacheLoaderTimeoutMillis(); final Object value; if (cacheLoaderTimeoutMillis > 0) {
element.addAttribute(new SimpleNodeAttribute("cacheLoaderTimeoutMillis", cacheConfiguration.getCacheLoaderTimeoutMillis()) .optional(true).defaultValue(0L)); element.addAttribute(new SimpleNodeAttribute("transactionalMode", cacheConfiguration.getTransactionalMode()).optional(true)
element.addAttribute(new SimpleNodeAttribute("overflowToOffHeap", cacheConfiguration.isOverflowToOffHeap())); element.addAttribute(new SimpleNodeAttribute("cacheLoaderTimeoutMillis", cacheConfiguration.getCacheLoaderTimeoutMillis()) .optional(true).defaultValue(0L)); element.addAttribute(new SimpleNodeAttribute("transactionalMode", cacheConfiguration.getTransactionalMode()).optional(true)
element.addAttribute(new SimpleNodeAttribute("cacheLoaderTimeoutMillis", cacheConfiguration.getCacheLoaderTimeoutMillis()) .optional(true).defaultValue(0L)); element.addAttribute(new SimpleNodeAttribute("transactionalMode", cacheConfiguration.getTransactionalMode()).optional(true)