public class InfinispanAsyncCache
extends java.lang.Object
implements io.micronaut.cache.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
AsyncCache
implementation based on Infinispan's org.infinispan.commons.api.AsyncCache
.Constructor and Description |
---|
InfinispanAsyncCache(org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object> nativeCache,
io.micronaut.core.convert.ConversionService<?> conversionService) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
get(java.lang.Object key,
io.micronaut.core.type.Argument<T> requiredType) |
<T> java.util.concurrent.CompletableFuture<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.lang.String |
getName() |
org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object> |
getNativeCache() |
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
invalidate(java.lang.Object key) |
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
invalidateAll() |
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
put(java.lang.Object key,
java.lang.Object value) |
<T> java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
putIfAbsent(java.lang.Object key,
T value) |
public InfinispanAsyncCache(org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object> nativeCache, io.micronaut.core.convert.ConversionService<?> conversionService)
nativeCache
- the Infinispan remote cacheconversionService
- the conversion service@Nonnull public <T> java.util.concurrent.CompletableFuture<java.util.Optional<T>> get(@Nonnull java.lang.Object key, @Nonnull io.micronaut.core.type.Argument<T> requiredType)
get
in interface io.micronaut.cache.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public <T> java.util.concurrent.CompletableFuture<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.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
@Nonnull public <T> java.util.concurrent.CompletableFuture<java.util.Optional<T>> putIfAbsent(@Nonnull java.lang.Object key, @Nonnull T value)
putIfAbsent
in interface io.micronaut.cache.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public java.util.concurrent.CompletableFuture<java.lang.Boolean> put(@Nonnull java.lang.Object key, @Nonnull java.lang.Object value)
put
in interface io.micronaut.cache.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public java.util.concurrent.CompletableFuture<java.lang.Boolean> invalidate(@Nonnull java.lang.Object key)
invalidate
in interface io.micronaut.cache.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public java.util.concurrent.CompletableFuture<java.lang.Boolean> invalidateAll()
invalidateAll
in interface io.micronaut.cache.AsyncCache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public org.reactivestreams.Publisher<io.micronaut.cache.CacheInfo> getCacheInfo()
getCacheInfo
in interface io.micronaut.cache.Cache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public java.lang.String getName()
getName
in interface io.micronaut.cache.Cache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>
public org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object> getNativeCache()
getNativeCache
in interface io.micronaut.cache.Cache<org.infinispan.client.hotrod.RemoteCache<java.lang.Object,java.lang.Object>>