/** * Constructs a storage backend using the provided Ehcache * with the given configuration options, but using an alternative * cache entry serialization strategy. * @param cache where to store cached origin responses * @param config cache storage configuration options - note that * the setting for max object size <b>will be ignored</b> and * should be configured in the Ehcache instead. * @param serializer alternative serialization mechanism */ public EhcacheHttpCacheStorage(final Ehcache cache, final CacheConfig config, final HttpCacheEntrySerializer serializer){ this.cache = cache; this.maxUpdateRetries = config.getMaxUpdateRetries(); this.serializer = serializer; }
/** * Constructs a storage backend using the provided Ehcache * with the given configuration options, but using an alternative * cache entry serialization strategy. * @param cache where to store cached origin responses * @param config cache storage configuration options - note that * the setting for max object size <b>will be ignored</b> and * should be configured in the Ehcache instead. * @param serializer alternative serialization mechanism */ public EhcacheHttpCacheStorage(Ehcache cache, CacheConfig config, HttpCacheEntrySerializer serializer){ this.cache = cache; this.maxUpdateRetries = config.getMaxUpdateRetries(); this.serializer = serializer; }
/** * Create a storage backend using the given <i>memcached</i> client and * applying the given cache configuration, serialization, and hashing * mechanisms. * @param client how to talk to <i>memcached</i> * @param config apply HTTP cache-related options * @param memcachedCacheEntryFactory Factory pattern used for obtaining * instances of alternative cache entry serialization mechanisms * @param keyHashingScheme how to map higher-level logical "storage keys" * onto "cache keys" suitable for use with memcached */ public MemcachedHttpCacheStorage(final MemcachedClientIF client, final CacheConfig config, final MemcachedCacheEntryFactory memcachedCacheEntryFactory, final KeyHashingScheme keyHashingScheme) { this.client = client; this.maxUpdateRetries = config.getMaxUpdateRetries(); this.memcachedCacheEntryFactory = memcachedCacheEntryFactory; this.keyHashingScheme = keyHashingScheme; }
/** * Create a storage backend using the given <i>memcached</i> client and * applying the given cache configuration, serialization, and hashing * mechanisms. * @param client how to talk to <i>memcached</i> * @param config apply HTTP cache-related options * @param memcachedCacheEntryFactory Factory pattern used for obtaining * instances of alternative cache entry serialization mechanisms * @param keyHashingScheme how to map higher-level logical "storage keys" * onto "cache keys" suitable for use with memcached */ public MemcachedHttpCacheStorage(MemcachedClientIF client, CacheConfig config, MemcachedCacheEntryFactory memcachedCacheEntryFactory, KeyHashingScheme keyHashingScheme) { this.client = client; this.maxUpdateRetries = config.getMaxUpdateRetries(); this.memcachedCacheEntryFactory = memcachedCacheEntryFactory; this.keyHashingScheme = keyHashingScheme; }
public static Builder copy(final CacheConfig config) { Args.notNull(config, "Cache config"); return new Builder() .setMaxObjectSize(config.getMaxObjectSize()) .setMaxCacheEntries(config.getMaxCacheEntries()) .setMaxUpdateRetries(config.getMaxUpdateRetries()) .setHeuristicCachingEnabled(config.isHeuristicCachingEnabled()) .setHeuristicCoefficient(config.getHeuristicCoefficient()) .setHeuristicDefaultLifetime(config.getHeuristicDefaultLifetime()) .setSharedCache(config.isSharedCache()) .setAsynchronousWorkersMax(config.getAsynchronousWorkersMax()) .setAsynchronousWorkersCore(config.getAsynchronousWorkersCore()) .setAsynchronousWorkerIdleLifetimeSecs(config.getAsynchronousWorkerIdleLifetimeSecs()) .setRevalidationQueueSize(config.getRevalidationQueueSize()) .setNeverCacheHTTP10ResponsesWithQueryString(config.isNeverCacheHTTP10ResponsesWithQuery()); }