public class EhcacheSyncCache
extends java.lang.Object
implements io.micronaut.cache.SyncCache<org.ehcache.Cache>
SyncCache
implementation based on Ehcache.Constructor and Description |
---|
EhcacheSyncCache(io.micronaut.core.convert.ConversionService<?> conversionService,
EhcacheConfiguration configuration,
org.ehcache.Cache nativeCache,
java.util.concurrent.ExecutorService executorService,
org.ehcache.core.spi.service.StatisticsService statisticsService) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.Optional<T> |
get(java.lang.Object key,
io.micronaut.core.type.Argument<T> requiredType) |
<T> T |
get(java.lang.Object key,
io.micronaut.core.type.Argument<T> requiredType,
java.util.function.Supplier<T> supplier) |
org.reactivestreams.Publisher<io.micronaut.cache.CacheInfo> |
getCacheInfo() |
java.util.concurrent.ExecutorService |
getExecutorService() |
java.lang.String |
getName() |
org.ehcache.Cache |
getNativeCache() |
void |
invalidate(java.lang.Object key) |
void |
invalidateAll() |
void |
put(java.lang.Object key,
java.lang.Object value) |
<T> java.util.Optional<T> |
putIfAbsent(java.lang.Object key,
T value) |
public EhcacheSyncCache(io.micronaut.core.convert.ConversionService<?> conversionService, EhcacheConfiguration configuration, org.ehcache.Cache nativeCache, @Named(value="io") java.util.concurrent.ExecutorService executorService, org.ehcache.core.spi.service.StatisticsService statisticsService)
conversionService
- the conversion serviceconfiguration
- the configurationnativeCache
- the native cacheexecutorService
- the executor service to offload synchronous operationsstatisticsService
- th Ehcache statistics servicepublic java.util.concurrent.ExecutorService getExecutorService()
getExecutorService
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
@Nonnull public <T> java.util.Optional<T> get(@Nonnull java.lang.Object key, @Nonnull io.micronaut.core.type.Argument<T> requiredType)
get
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
public <T> T get(@Nonnull java.lang.Object key, @Nonnull io.micronaut.core.type.Argument<T> requiredType, @Nonnull java.util.function.Supplier<T> supplier)
get
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
@Nonnull public <T> java.util.Optional<T> putIfAbsent(@Nonnull java.lang.Object key, @Nonnull T value)
putIfAbsent
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
public void put(@Nonnull java.lang.Object key, @Nonnull java.lang.Object value)
put
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
public void invalidate(@Nonnull java.lang.Object key)
invalidate
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
public void invalidateAll()
invalidateAll
in interface io.micronaut.cache.SyncCache<org.ehcache.Cache>
public java.lang.String getName()
getName
in interface io.micronaut.cache.Cache<org.ehcache.Cache>
public org.ehcache.Cache getNativeCache()
getNativeCache
in interface io.micronaut.cache.Cache<org.ehcache.Cache>
public org.reactivestreams.Publisher<io.micronaut.cache.CacheInfo> getCacheInfo()
getCacheInfo
in interface io.micronaut.cache.Cache<org.ehcache.Cache>