Package net.sf.ehcache.constructs.blocking

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


    public void setCachePermissions(boolean cachePermissions) {
        this.cachePermissions = cachePermissions;
    }
    @Autowired
    public void setPrincipalCache(@Qualifier(CacheFactory.PRINCIPAL_CACHEEhcache principalCache) {
        this.principalCache = new SelfPopulatingCache(principalCache, new CacheEntryFactory() {
            @Override
            public Object createEntry(Object key) throws Exception {
                final Tuple<String, Class> principalKey = (Tuple<String, Class>)key;
                return primNewPrincipal(principalKey.first, principalKey.second);
            }
View Full Code Here


    if (this.cacheEntryFactory != null) {
      if (this.cacheEntryFactory instanceof UpdatingCacheEntryFactory) {
        return new UpdatingSelfPopulatingCache(cache, (UpdatingCacheEntryFactory) this.cacheEntryFactory);
      }
      else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
View Full Code Here

    if (this.cacheEntryFactory != null) {
      if (this.cacheEntryFactory instanceof UpdatingCacheEntryFactory) {
        return new UpdatingSelfPopulatingCache(cache,
            (UpdatingCacheEntryFactory) this.cacheEntryFactory);
      } else {
        return new SelfPopulatingCache(cache, this.cacheEntryFactory);
      }
    }
    if (this.blocking) {
      return new BlockingCache(cache);
    }
View Full Code Here

      s_logger.warn("Could not load a cache configuration for " + name + CACHE_NAME_SUFFIX
                  + ", building a default configuration programmatically instead");
      getCacheManager().addCache(new Cache(tweakCacheConfiguration(new CacheConfiguration(name + CACHE_NAME_SUFFIX,
                                                                                          10000))));
    }
    _uidToDocumentCache = new SelfPopulatingCache(_cacheManager.getCache(name + CACHE_NAME_SUFFIX),
                                                  new UidToDocumentCacheEntryFactory<>(_underlying));
    getCacheManager().replaceCacheWithDecoratedCache(_cacheManager.getCache(name + CACHE_NAME_SUFFIX),
                                                     getUidToDocumentCache());

    // Listen to change events from underlying, clean this cache accordingly and relay events to our change listeners
View Full Code Here

TOP

Related Classes of net.sf.ehcache.constructs.blocking.SelfPopulatingCache

Copyright © 2018 www.massapicom. 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.