Class EhCacheConfigManager
- java.lang.Object
-
- com.atlassian.confluence.cache.ehcache.EhCacheConfigManager
-
- All Implemented Interfaces:
CacheConfigManager
,org.springframework.beans.factory.InitializingBean
public class EhCacheConfigManager extends Object implements CacheConfigManager, org.springframework.beans.factory.InitializingBean
Class that allows Confluence's ehcache configuration to be modified programmatically. Changes will be made to both the runtime configuration as well as the persisted configuration (allowing changes to persist across restarts).
-
-
Field Summary
Fields Modifier and Type Field Description static String
CACHE_MAX_ENTRIES_LOCAL_HEAP_CONFIG_KEY_PREFIX
-
Constructor Summary
Constructors Constructor Description EhCacheConfigManager(EhCacheConfigStore ehCacheConfigStore, EhCacheManager ehCacheManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
changeMaxCacheSize(String cacheName, int newMaxCacheSize)
Changes the maximum cache size of the specified cache (both in runtime and where its persisted).
-
-
-
Field Detail
-
CACHE_MAX_ENTRIES_LOCAL_HEAP_CONFIG_KEY_PREFIX
public static final String CACHE_MAX_ENTRIES_LOCAL_HEAP_CONFIG_KEY_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EhCacheConfigManager
public EhCacheConfigManager(EhCacheConfigStore ehCacheConfigStore, EhCacheManager ehCacheManager)
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
changeMaxCacheSize
public void changeMaxCacheSize(String cacheName, int newMaxCacheSize)
Changes the maximum cache size of the specified cache (both in runtime and where its persisted). If no config is explicitly declared, a new cache configuration is created based off of the default configuration.- Specified by:
changeMaxCacheSize
in interfaceCacheConfigManager
- Parameters:
cacheName
- name of cachenewMaxCacheSize
- new max cache size
-
-