List of usage examples for org.apache.http.impl.client.cache.ehcache EhcacheHttpCacheStorage EhcacheHttpCacheStorage
public EhcacheHttpCacheStorage(Ehcache cache, CacheConfig config)
From source file:org.esigate.cache.EhcacheCacheStorage.java
@Override public void init(Properties properties) { String cacheName = Parameters.EHCACHE_CACHE_NAME_PROPERTY.getValue(properties); String configurationFileName = Parameters.EHCACHE_CONFIGURATION_FILE_PROPERTY.getValue(properties); // Loaded from the Classpath, default will use /ehcache.xml or if not found /ehcache-failsafe.xml CacheManager cacheManager = CacheManager.create(configurationFileName); Ehcache ehcache = cacheManager.getEhcache(cacheName); if (ehcache == null) { cacheManager.addCache(cacheName); ehcache = cacheManager.getEhcache(cacheName); }//from w w w.j a v a2s. c om CacheConfig cacheConfig = CacheConfigHelper.createCacheConfig(properties); setImpl(new EhcacheHttpCacheStorage(ehcache, cacheConfig)); }