@Replaces(value=DefaultCacheManager.class) @Requires(beans=javax.cache.CacheManager.class) @Requires(property="micronaut.jcache.enabled",value="true",defaultValue="true") @Primary public class JCacheManager extends Object implements CacheManager<javax.cache.Cache>
DefaultCacheManager
if a JCache bean is present.Modifier and Type | Field and Description |
---|---|
static String |
JCACHE_ENABLED
Whether JCache integration is enabled.
|
Modifier | Constructor and Description |
---|---|
protected |
JCacheManager(javax.cache.CacheManager cacheManager,
ExecutorService executorService,
ConversionService<?> conversionService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
SyncCache<javax.cache.Cache> |
getCache(String name)
Retrieve a cache for the given name.
|
javax.cache.CacheManager |
getCacheManager() |
Set<String> |
getCacheNames() |
public static final String JCACHE_ENABLED
protected JCacheManager(@Nonnull javax.cache.CacheManager cacheManager, @Nonnull @Named(value="io") ExecutorService executorService, @Nonnull ConversionService<?> conversionService)
cacheManager
- The cache managerexecutorService
- The executor to execute I/O operationsconversionService
- The conversion service@Nonnull public Set<String> getCacheNames()
getCacheNames
in interface CacheManager<javax.cache.Cache>
@Nonnull public SyncCache<javax.cache.Cache> getCache(String name)
CacheManager
getCache
in interface CacheManager<javax.cache.Cache>
name
- The name of the cacheSyncCache
instance@Nonnull public javax.cache.CacheManager getCacheManager()