Package io.micronaut.cache
Class DefaultCacheManager<C>
- java.lang.Object
-
- io.micronaut.cache.DefaultCacheManager<C>
-
- Type Parameters:
C- The native cache implementation
- All Implemented Interfaces:
CacheManager<C>
@Singleton @Primary public class DefaultCacheManager<C> extends java.lang.Object implements CacheManager<C>
Default implementation of theCacheManagerinterface.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description DefaultCacheManager(SyncCache<C>... caches)Create default cache manager for the given caches.DefaultCacheManager(java.util.List<SyncCache<C>> caches, io.micronaut.context.BeanProvider<DynamicCacheManager<C>> dynamicCacheManager)Create default cache manager for the given caches.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SyncCache<C>getCache(java.lang.String name)Retrieve a cache for the given name.java.util.Set<java.lang.String>getCacheNames()
-
-
-
Constructor Detail
-
DefaultCacheManager
@Inject public DefaultCacheManager(java.util.List<SyncCache<C>> caches, @Nullable io.micronaut.context.BeanProvider<DynamicCacheManager<C>> dynamicCacheManager)
Create default cache manager for the given caches.- Parameters:
caches- List of synchronous cache implementationsdynamicCacheManager- The dynamic cache manager
-
-
Method Detail
-
getCacheNames
@NonNull public java.util.Set<java.lang.String> getCacheNames()
- Specified by:
getCacheNamesin interfaceCacheManager<C>- Returns:
- The names of the active caches
-
getCache
@NonNull public SyncCache<C> getCache(java.lang.String name)
Description copied from interface:CacheManagerRetrieve a cache for the given name.- Specified by:
getCachein interfaceCacheManager<C>- Parameters:
name- The name of the cache- Returns:
- The
SyncCacheinstance
-
-