@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,
io.micronaut.core.convert.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 io.micronaut.core.convert.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()