Class DefaultCacheManager
- java.lang.Object
-
- com.github.dozermapper.core.cache.DefaultCacheManager
-
- All Implemented Interfaces:
CacheManager
public final class DefaultCacheManager extends Object implements CacheManager
-
-
Constructor Summary
Constructors Constructor Description DefaultCacheManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancacheExists(String name)Checks if cache name existsvoidclearAllEntries()Clears all available caches.CachegetCache(String name)Get cache object by name.Collection<String>getCacheNames()Returns a collection of all cache namesCollection<Cache>getCaches()Returns a collection of all cachesCacheputCache(String name, int maxElementsInMemory)Puts cache object into store
-
-
-
Method Detail
-
getCaches
public Collection<Cache> getCaches()
Returns a collection of all caches- Specified by:
getCachesin interfaceCacheManager- Returns:
- collection of all caches
-
getCache
public Cache getCache(String name) throws MappingException
Get cache object by name.- Specified by:
getCachein interfaceCacheManager- Parameters:
name- unique cache name- Returns:
- Cache object found
- Throws:
MappingException- exception is thrown if no cache found
-
putCache
public Cache putCache(String name, int maxElementsInMemory)
Puts cache object into store- Specified by:
putCachein interfaceCacheManager- Parameters:
name- cache name to storemaxElementsInMemory- maximum number of objects to store in cache- Returns:
- Cache object created
-
getCacheNames
public Collection<String> getCacheNames()
Returns a collection of all cache names- Specified by:
getCacheNamesin interfaceCacheManager- Returns:
- Collection of all cache names
-
clearAllEntries
public void clearAllEntries()
Clears all available caches. Should not be used in production. Can be applied on "soft" application restart.- Specified by:
clearAllEntriesin interfaceCacheManager
-
cacheExists
public boolean cacheExists(String name)
Checks if cache name exists- Specified by:
cacheExistsin interfaceCacheManager- Parameters:
name- cache name to find- Returns:
- true if found, false if doesn't exist
-
-