Package io.mangoo.cache
Class CacheProvider
- java.lang.Object
-
- io.mangoo.cache.CacheProvider
-
-
Constructor Summary
Constructors Constructor Description CacheProvider(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes all cachesCacheget()CachegetCache(CacheName name)Retrieves a cache by its name from the cache poolCachegetCache(String name)Retrieves a cache by its name from the cache poolMap<String,org.ehcache.core.statistics.CacheStatistics>getCacheStatistics()Returns a map containing cache names and cache statisticsvoidregisterCacheConfiguration(String name, org.ehcache.config.CacheConfiguration<String,Object> configuration)Registers a new cache with custom configuration
-
-
-
Constructor Detail
-
CacheProvider
@Inject public CacheProvider(Config config)
-
-
Method Detail
-
registerCacheConfiguration
public void registerCacheConfiguration(String name, org.ehcache.config.CacheConfiguration<String,Object> configuration)
Registers a new cache with custom configuration- Parameters:
name- The name of the cacheconfiguration- The configuration for the cache to use
-
getCacheStatistics
public Map<String,org.ehcache.core.statistics.CacheStatistics> getCacheStatistics()
Returns a map containing cache names and cache statistics- Returns:
- Map of cache statistics
-
getCache
public Cache getCache(CacheName name)
Retrieves a cache by its name from the cache pool- Parameters:
name- The name of the cache- Returns:
- An Cache instance
-
getCache
public Cache getCache(String name)
Retrieves a cache by its name from the cache pool- Parameters:
name- The name of the cache- Returns:
- An Cache instance
-
close
public void close()
Closes all caches
-
-