/** * Allows BeanHandler to add the PinningConfiguration to the configuration. */ public final void addPinning(PinningConfiguration pinningConfiguration) { this.pinningConfiguration = pinningConfiguration; validateConfiguration(); }
/** * Allows BeanHandler to add the TerracottaConfiguration to the configuration. */ public final void addTerracotta(TerracottaConfiguration terracottaConfiguration) { this.terracottaConfiguration = terracottaConfiguration; validateConfiguration(); }
/** * Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration. */ public final void addCacheEventListenerFactory(CacheEventListenerFactoryConfiguration factory) { checkDynamicChange(); cacheEventListenerConfigurations.add(factory); validateConfiguration(); }
/** * Used to validate what should be a complete Cache Configuration. */ public void validateCompleteConfiguration() { validateConfiguration(); // Extra checks that a completed cache config should have if (name == null) { throw new InvalidConfigurationException("Caches must be named."); } }
/** * Sets whether elements can overflow to disk when the in-memory cache has reached the set limit. * * @param overflowToDisk whether to use the disk store * @deprecated The {@code overflowToDisk} attribute has been replaced with {@link Strategy#LOCALTEMPSWAP}. */ @Deprecated public final void setOverflowToDisk(boolean overflowToDisk) { checkDynamicChange(); if (persistenceConfiguration != null && Boolean.TRUE.equals(overflowToDisk)) { throw new InvalidConfigurationException("Cannot use both <persistence ...> and overflowToDisk in a single cache configuration."); } this.overflowToDisk = overflowToDisk; validateConfiguration(); }
/** * Sets whether the disk store persists between CacheManager instances. Note that this operates independently of {@link #overflowToDisk}. * * @param diskPersistent whether to persist the cache to disk between JVM restarts * @deprecated The {@code diskPersistent} attribute has been replaced with {@link #persistence(PersistenceConfiguration)}. */ @Deprecated public final void setDiskPersistent(boolean diskPersistent) { checkDynamicChange(); if (persistenceConfiguration != null) { throw new InvalidConfigurationException("Cannot use both <persistence ...> and diskPersistent in a single cache configuration."); } this.diskPersistent = diskPersistent; validateConfiguration(); }
/** * Allows BeanHandler to add the PinningConfiguration to the configuration. */ public final void addPinning(PinningConfiguration pinningConfiguration) { this.pinningConfiguration = pinningConfiguration; validateConfiguration(); }
/** * Allows BeanHandler to add the PinningConfiguration to the configuration. */ public final void addPinning(PinningConfiguration pinningConfiguration) { this.pinningConfiguration = pinningConfiguration; validateConfiguration(); }
/** * Allows BeanHandler to add the TerracottaConfiguration to the configuration. */ public final void addTerracotta(TerracottaConfiguration terracottaConfiguration) { this.terracottaConfiguration = terracottaConfiguration; validateConfiguration(); }
/** * Allows BeanHandler to add the TerracottaConfiguration to the configuration. */ public final void addTerracotta(TerracottaConfiguration terracottaConfiguration) { this.terracottaConfiguration = terracottaConfiguration; validateConfiguration(); }
/** * Allows BeanHandler to add the PinningConfiguration to the configuration. */ public final void addPinning(PinningConfiguration pinningConfiguration) { this.pinningConfiguration = pinningConfiguration; validateConfiguration(); }
/** * Allows BeanHandler to add the TerracottaConfiguration to the configuration. */ public final void addTerracotta(TerracottaConfiguration terracottaConfiguration) { this.terracottaConfiguration = terracottaConfiguration; validateConfiguration(); }
/** * Used to validate what should be a complete Cache Configuration. */ public void validateCompleteConfiguration() { validateConfiguration(); // Extra checks that a completed cache config should have if (name == null) { throw new InvalidConfigurationException("Caches must be named."); } }
/** * Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration. */ public final void addCacheEventListenerFactory(CacheEventListenerFactoryConfiguration factory) { checkDynamicChange(); cacheEventListenerConfigurations.add(factory); validateConfiguration(); }
/** * Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration. */ public final void addCacheEventListenerFactory(CacheEventListenerFactoryConfiguration factory) { checkDynamicChange(); cacheEventListenerConfigurations.add(factory); validateConfiguration(); }
/** * Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration. */ public final void addCacheEventListenerFactory(CacheEventListenerFactoryConfiguration factory) { checkDynamicChange(); cacheEventListenerConfigurations.add(factory); validateConfiguration(); }
/** * Used to validate what should be a complete Cache Configuration. */ public void validateCompleteConfiguration() { validateConfiguration(); // Extra checks that a completed cache config should have if (name == null) { throw new InvalidConfigurationException("Caches must be named."); } }
/** * Used to validate what should be a complete Cache Configuration. */ public void validateCompleteConfiguration() { validateConfiguration(); // Extra checks that a completed cache config should have if (name == null) { throw new InvalidConfigurationException("Caches must be named."); } }
/** * Sets whether elements can overflow to disk when the in-memory cache has reached the set limit. * * @param overflowToDisk whether to use the disk store * @deprecated The {@code overflowToDisk} attribute has been replaced with {@link Strategy#LOCALTEMPSWAP}. */ @Deprecated public final void setOverflowToDisk(boolean overflowToDisk) { checkDynamicChange(); if (persistenceConfiguration != null && Boolean.TRUE.equals(overflowToDisk)) { throw new InvalidConfigurationException("Cannot use both <persistence ...> and overflowToDisk in a single cache configuration."); } this.overflowToDisk = overflowToDisk; validateConfiguration(); }
public DefaultCacheManagerProvider() { net.sf.ehcache.config.Configuration config = new net.sf.ehcache.config.Configuration(); config.setUpdateCheck(false); CacheConfiguration tokenCacheConfiguration = new CacheConfiguration(). maxEntriesLocalHeap(DEFAULT_MAX_CACHE_ENTRIES). name("tokenCache"). persistence(new PersistenceConfiguration().strategy(Strategy.NONE)); tokenCacheConfiguration.validateConfiguration(); config.addCache(tokenCacheConfiguration ); cacheManager = CacheManager.create(config); }