@Replaces(value=DefaultCacheManager.class) @Requires(beans=javax.cache.CacheManager.class) @Requires(property="micronaut.jcache.enabled",value="true",defaultValue="true") @Primary public class JCacheManager extends java.lang.Object implements CacheManager<javax.cache.Cache>
DefaultCacheManager
if a JCache bean is present.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JCACHE_ENABLED
Whether JCache integration is enabled.
|
Modifier | Constructor and Description |
---|---|
protected |
JCacheManager(javax.cache.CacheManager cacheManager,
java.util.concurrent.ExecutorService executorService,
io.micronaut.core.convert.ConversionService<?> conversionService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
SyncCache<javax.cache.Cache> |
getCache(java.lang.String name)
Retrieve a cache for the given name.
|
javax.cache.CacheManager |
getCacheManager() |
java.util.Set<java.lang.String> |
getCacheNames() |
public static final java.lang.String JCACHE_ENABLED
protected JCacheManager(@NonNull javax.cache.CacheManager cacheManager, @NonNull @Named(value="io") java.util.concurrent.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 java.util.Set<java.lang.String> getCacheNames()
getCacheNames
in interface CacheManager<javax.cache.Cache>
@NonNull public SyncCache<javax.cache.Cache> getCache(java.lang.String name)
CacheManager
getCache
in interface CacheManager<javax.cache.Cache>
name
- The name of the cacheSyncCache
instance@NonNull public javax.cache.CacheManager getCacheManager()