Examples of BlockingCache


Examples of net.sf.ehcache.constructs.blocking.BlockingCache

             throw new CacheException("cache '" + cacheName
                     + "' not found in configuration");
         }
         if (!(cache instanceof BlockingCache)) {
             // decorate and substitute
             BlockingCache newBlockingCache = new BlockingCache(cache);
             getCacheManager().replaceCacheWithDecoratedCache(cache, newBlockingCache);
         }
         blockingCache = (BlockingCache) getCacheManager().getEhcache(cacheName);
         return blockingCache;
  }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

    private BlockingCache cache;


    public void setCache(Ehcache cache) {
        BlockingCache ref;

        if (!(cache instanceof BlockingCache)) {
            ref = new BlockingCache(cache);
            cache.getCacheManager().replaceCacheWithDecoratedCache(cache, new BlockingCache(cache));
        } else {
            ref = (BlockingCache) cache;
        }

        this.cache = ref;
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

      else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
    return cache;
  }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

      else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
    return cache;
  }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

      else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
    return cache;
  }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

      else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
    return cache;
  }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

      else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
    return cache;
  }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

            if (blockingCache == null) {
                final String cacheName = getCacheName();
                Ehcache cache = getCacheManager().getEhcache(cacheName);
                if (!(cache instanceof BlockingCache)) {
                    //decorate and substitute
                    BlockingCache newBlockingCache = new BlockingCache(cache);
                    getCacheManager().replaceCacheWithDecoratedCache(cache, newBlockingCache);
                }
                blockingCache = (BlockingCache) getCacheManager().getEhcache(getCacheName());
            }
        }
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

public class EhcacheLimitStore implements LimitStore {

    private BlockingCache cache;

    public void setCache(Ehcache cache) {
        BlockingCache ref;

        if (!(cache instanceof BlockingCache)) {
            ref = new BlockingCache(cache);
            cache.getCacheManager().replaceCacheWithDecoratedCache(cache, new BlockingCache(cache));
        } else {
            ref = (BlockingCache)cache;
        }

        this.cache = ref;
View Full Code Here

Examples of net.sf.ehcache.constructs.blocking.BlockingCache

  }

  private void purgeCaches(Collection<Run> runs) {
    Cache lcache = cacheManager.getCache("runListCache");
    if (lcache != null) {
      BlockingCache listCache = new BlockingCache(lcache);
      if (listCache.getKeys().size() > 0) {
        Object cachekey = listCache.getKeys().get(0);
        if (cachekey != null) {
          List<Run> cachedruns = (List<Run>)listCache.get(cachekey).getValue();
          for (Run run : runs) {
            cachedruns.remove(run);
            cachedruns.add(run);
          }
          listCache.put(new Element(cachekey, cachedruns));
        }
      }
    }

    Cache rcache = cacheManager.getCache("runCache");
    if (rcache != null) {
      BlockingCache cache = new BlockingCache(rcache);
      HashCodeCacheKeyGenerator keygen = new HashCodeCacheKeyGenerator();
      for (Run run : runs) {
        Long cachekey = keygen.generateKey(run);
        cache.remove(cachekey);
        cache.put(new Element(cachekey, run));
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.