Package com.atlassian.cache.ehcache
Class EhCacheManager
java.lang.Object
com.atlassian.cache.impl.AbstractCacheManager
com.atlassian.cache.ehcache.EhCacheManager
- All Implemented Interfaces:
CacheFactory,CacheManager,MBeanRegistrar
@ParametersAreNonnullByDefault
public class EhCacheManager
extends AbstractCacheManager
implements MBeanRegistrar
Maintains a mapping of name -> Cache and provides factory methods for creating ad getting caches.
- Since:
- 2.0
-
Field Summary
Fields inherited from class com.atlassian.cache.impl.AbstractCacheManager
cacheCreationLocks, caches, cacheSettingsDefaultsProvider -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.EhCacheManager(net.sf.ehcache.CacheManager delegate, CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider) Deprecated.EhCacheManager(net.sf.ehcache.CacheManager delegate, EhCacheReplicatorConfigFactory replicatorConfigFactory, CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider) Creates an instance backed by the provided instance ofCacheManager.EhCacheManager(net.sf.ehcache.CacheManager delegate, EhCacheReplicatorConfigFactory replicatorConfigFactory, CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider, ValueProcessor valueProcessor) Creates an instance backed by the provided instance ofCacheManager. -
Method Summary
Modifier and TypeMethodDescriptionprotected <K,V> ManagedCache createComputingCache(String name, CacheSettings settings, CacheLoader<K, V> loader) protected ManagedCachecreateSimpleCache(String name, CacheSettings settings) <V> CachedReference<V>getCachedReference(String name, Supplier<V> supplier, CacheSettings settings) booleanvoidregisterMBeans(MBeanServer mBeanServer) voidsetStatisticsEnabled(boolean statisticsEnabled) voidshutdown()voidunregisterMBeans(MBeanServer mBeanServer) Methods inherited from class com.atlassian.cache.impl.AbstractCacheManager
flushCaches, getCache, getCache, getCache, getCache, getCache, getCachedReference, getCachedReference, getCachedReference, getCaches, getManagedCache, getManagedCaches, mergeSettingsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.cache.CacheFactory
getReadThroughCache, getReadThroughCache
-
Constructor Details
-
EhCacheManager
Deprecated.Creates an instance backed by a new instance ofCacheManagerand aRMICacheReplicatorConfigFactory. -
EhCacheManager
@Deprecated public EhCacheManager(net.sf.ehcache.CacheManager delegate, @Nullable CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider) Deprecated.Creates an instance backed by the provided instance ofCacheManagerand aRMICacheReplicatorConfigFactory.- Parameters:
delegate- an Ehcache's cache manager
-
EhCacheManager
public EhCacheManager(net.sf.ehcache.CacheManager delegate, @Nullable EhCacheReplicatorConfigFactory replicatorConfigFactory, @Nullable CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider) Creates an instance backed by the provided instance ofCacheManager.- Parameters:
delegate- an Ehcache's cache manager
-
EhCacheManager
public EhCacheManager(net.sf.ehcache.CacheManager delegate, @Nullable EhCacheReplicatorConfigFactory replicatorConfigFactory, @Nullable CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider, @Nullable ValueProcessor valueProcessor) Creates an instance backed by the provided instance ofCacheManager.- Parameters:
delegate- an Ehcache's cache manager
-
-
Method Details
-
isStatisticsEnabled
public boolean isStatisticsEnabled() -
setStatisticsEnabled
public void setStatisticsEnabled(boolean statisticsEnabled) -
getCachedReference
@Nonnull public <V> CachedReference<V> getCachedReference(@Nonnull String name, @Nonnull Supplier<V> supplier, @Nonnull CacheSettings settings) - Specified by:
getCachedReferencein interfaceCacheFactory
-
createSimpleCache
- Specified by:
createSimpleCachein classAbstractCacheManager
-
createComputingCache
protected <K,V> ManagedCache createComputingCache(@Nonnull String name, @Nonnull CacheSettings settings, CacheLoader<K, V> loader) - Specified by:
createComputingCachein classAbstractCacheManager
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceCacheManager- Overrides:
shutdownin classAbstractCacheManager
-
registerMBeans
- Specified by:
registerMBeansin interfaceMBeanRegistrar
-
unregisterMBeans
- Specified by:
unregisterMBeansin interfaceMBeanRegistrar
-
EhCacheManager(CacheManager, EhCacheReplicatorConfigFactory, CacheSettingsDefaultsProvider)