/** * Construct a new cache configuration. * @return A new configuration with all default values. */ public static CacheConfig newConfig() { return new MutableConfig(); } }
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); } }
private static CacheConfig getDefaultConfig() { MutableConfig config = new MutableConfig(); config.setMaxTTISeconds(0); config.setMaxTTLSeconds(0); config.setOrphanEvictionEnabled(false); ImmutableConfig rv = new ImmutableConfig(config); if (rv.isEvictionEnabled()) { throw new AssertionError("Eviction is enabled? " + config); } return rv; }
public Configuration newConfiguration(String cacheName, String configDeclaration, CacheType cacheType, IsolationLevel isolation, boolean keyCache, int keyMaxSize, boolean unlockedRead, boolean logging, int maxTti, int maxTtl, boolean orphanEviction, int orphanPeriod, int targetMaxInMemoryCount, int targetMaxTotalCount) { return new ImmutableConfiguration(cacheName, configDeclaration, cacheType, isolation, keyCache, keyMaxSize, unlockedRead, new MutableConfig().setName(cacheName).setLoggingEnabled(logging) .setMaxTTISeconds(maxTti).setMaxTTLSeconds(maxTtl) .setOrphanEvictionEnabled(orphanEviction) .setOrphanEvictionPeriod(orphanPeriod) .setTargetMaxInMemoryCount(targetMaxInMemoryCount) .setTargetMaxTotalCount(targetMaxTotalCount)); }
public ClusteredStore(final Ehcache cache) { final CacheConfig config = new MutableConfig(); final CacheConfiguration ehcacheConfig = cache.getCacheConfiguration();