public EHCacheProvider() { cacheManager = net.sf.ehcache.CacheManager.create(); }
public EHCacheProvider(URL configurationFileURL) { this.cacheManager = net.sf.ehcache.CacheManager.create(configurationFileURL); }
public EHCacheProvider(InputStream inputStream) { this.cacheManager = net.sf.ehcache.CacheManager.create(inputStream); }
public EHCacheProvider(Configuration configuration) { this.cacheManager = net.sf.ehcache.CacheManager.create(configuration); }
public EHCacheProvider() { cacheManager = CacheManager.create(); }
private void createCacheManager() { if (cacheManager != null) { return ; } if (configurationFileName != null) { cacheManager = CacheManager.create(configurationFileName); return ; } if (configurationFileURL != null) { cacheManager = CacheManager.create(configurationFileURL); return ; } if (inputStream != null) { cacheManager = CacheManager.create(inputStream); return ; } if (configuration != null) { cacheManager = CacheManager.create(configuration); return ; } cacheManager = CacheManager.create(); }
@Inject public CacheEhCacheImpl(Logger logger) { this.logger = logger; this.ehCacheManager = CacheManager.create(); this.ehCacheManager.addCacheIfAbsent(cacheName); this.ehCache = ehCacheManager.getCache(cacheName); }
this.cacheManager = CacheManager.create(configuration);
this.cacheManager = CacheManager.create(configuration);
@BeforeClass public static void initCacheManaer() { cacheManager = CacheManager.create(); cacheManager.addCache(new Cache("ehcacheusercachetests", 500, false, false, 30, 30)); }
@BeforeClass public static void initCacheManaer() { cacheManager = CacheManager.create(); cacheManager.addCache(new Cache("basiclookuptestcache", 500, false, false, 30, 30)); }
@BeforeClass public static void initCacheManaer() { cacheManager = CacheManager.create(); cacheManager.addCache(new Cache("castickets", 500, false, false, 30, 30)); }
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; }
private synchronized Cache getHeap() { if (offHeap == null) { if (CacheManager.getInstance().cacheExists("hydrated-offheap-cache")) { offHeap = CacheManager.getInstance().getCache("hydrated-offheap-cache"); } else { CacheConfiguration config = new CacheConfiguration("hydrated-offheap-cache", 500).eternal(true).overflowToOffHeap(true).maxMemoryOffHeap("1400M"); Cache cache = new Cache(config); CacheManager.create().addCache(cache); offHeap = cache; } } return offHeap; }
CacheManager cacheManager = CacheManager.create(conf);
/** * A factory method to create a singleton CacheManager with default config, or return it if it exists. * <p> * This has the same effect as {@link CacheManager#create} * <p> * Same as {@link #create()} * * @return the singleton CacheManager * @throws CacheException * if the CacheManager cannot be created */ public static CacheManager getInstance() throws CacheException { return CacheManager.create(); }
@DB() protected void createCache(final Map<String, ? extends Object> params) { final String value = (String)params.get("cache.size"); if (value != null) { final CacheManager cm = CacheManager.create(); final int maxElements = NumbersUtil.parseInt(value, 0); final int live = NumbersUtil.parseInt((String)params.get("cache.time.to.live"), 300); final int idle = NumbersUtil.parseInt((String)params.get("cache.time.to.idle"), 300); _cache = new Cache(getName(), maxElements, false, live == -1, live == -1 ? Integer.MAX_VALUE : live, idle); cm.addCache(_cache); s_logger.info("Cache created: " + _cache.toString()); } else { _cache = null; } }
maxElements = Integer.parseInt(cachesize); CacheManager cm = CacheManager.create(); Cache cache = new Cache("api-limit-cache", maxElements, false, false, timeToLive, timeToLive); cm.addCache(cache);