configuration.setName(uri.toString() + "::" + classLoader.toString() + "::" + this.toString()); configuration.setClassLoader(classLoader); final net.sf.ehcache.CacheManager ehcacheManager = new net.sf.ehcache.CacheManager(configuration); cacheManager = new JCacheManager(this, ehcacheManager, uri, properties);
configuration.setName(uri.toString() + "::" + classLoader.toString() + "::" + this.toString()); configuration.setClassLoader(classLoader); final net.sf.ehcache.CacheManager ehcacheManager = new net.sf.ehcache.CacheManager(configuration); cacheManager = new JCacheManager(this, ehcacheManager, uri, properties);
EhCacheService(String name) { if (S.notBlank(name)) { cacheName = name; } Configuration configuration = ConfigurationFactory.parseConfiguration(); configuration.setClassLoader(CacheServiceProvider.Impl.classLoader()); cacheManager = CacheManager.create(configuration); Cache cache = cacheManager.getCache(cacheName); if (null == cache) { cache = (Cache)cacheManager.addCacheIfAbsent(cacheName); } this.cache = cache; long l = this.cache.getCacheConfiguration().getTimeToLiveSeconds(); if (0 != l) { defaultTTL = (int)l; } }