com.atlassian.cache.memory
Class MemoryCacheManager
java.lang.Object
com.atlassian.cache.impl.AbstractCacheManager
com.atlassian.cache.memory.MemoryCacheManager
- All Implemented Interfaces:
- CacheFactory, CacheManager
public class MemoryCacheManager
- extends AbstractCacheManager
Maintains a mapping of name -> Cache and provides factory methods for creating and getting caches.
- Since:
- 2.0
| Methods inherited from class com.atlassian.cache.impl.AbstractCacheManager |
flushCaches, getCache, getCache, getCache, getCache, getCache, getCachedReference, getCachedReference, getCachedReference, getCaches, getManagedCache, getManagedCaches, mergeSettings, shutdown |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemoryCacheManager
@Nonnull
public MemoryCacheManager()
getCachedReference
@Nonnull
public <V> CachedReference<V> getCachedReference(@Nonnull
String name,
@Nonnull
Supplier<V> supplier,
@Nonnull
CacheSettings settings)
- Description copied from interface:
CacheFactory
- Returns a Cached Reference, creating it if necessary.
- Parameters:
name - the name of the Cached Referencesupplier - the supplier for value to be cached, called if the value needs to be generatedsettings - specifies the required cache settings
- Returns:
- the Cached Reference
createSimpleCache
protected ManagedCache createSimpleCache(@Nonnull
String name,
@Nonnull
CacheSettings settings)
- Description copied from class:
AbstractCacheManager
- Creates a cache with no loader, i.e. one populated via explicit puts.
- Specified by:
createSimpleCache in class AbstractCacheManager
- Parameters:
name - the name to give the cache (required)
- Returns:
- a non-null cache
createComputingCache
protected <K,V> ManagedCache createComputingCache(@Nonnull
String name,
@Nonnull
CacheSettings settings,
CacheLoader<K,V> loader)
- Description copied from class:
AbstractCacheManager
- Creates a cache that upon a miss is able to populate itself using the loader.
- Specified by:
createComputingCache in class AbstractCacheManager
- Returns:
- a non-null cache
Copyright © 2015 Atlassian. All rights reserved.