public <K, V> DistributedCache<K, V> newCache() { MutableConfig copyConfig = new MutableConfig(name, loggingEnabled, maxTTISeconds, maxTTLSeconds, orphanEvictionEnabled, orphanEvictionPeriod, targetMaxInMemoryCount, targetMaxTotalCount, capacityEvictionPolicyDataFactory); if (CacheConfigFactory.DSO_ACTIVE) { return new DistributedCacheImpl<K, V>(copyConfig); } else { return new LocalCache<K, V>(copyConfig); } }
/** * Construct a new cache instance based on the configuration changes specified in this instance of the builder so far. * If Terracotta is not being used, a non-clustered implementation will be returned instead. * * @param <K> Key type * @param <V> Value type * @return Map constructed by this method based on previous parameters and defaults */ public <K, V> DistributedCache<K, V> newCache() { MutableConfig copyConfig = new MutableConfig(name, loggingEnabled, maxTTISeconds, maxTTLSeconds, orphanEvictionEnabled, orphanEvictionPeriod, targetMaxInMemoryCount, targetMaxTotalCount, capacityEvictionPolicyDataFactory); if (CacheConfigFactory.DSO_ACTIVE) { return new DistributedCacheImpl<K, V>(copyConfig); } else { return new LocalCache<K, V>(copyConfig); } }