Package io.quarkus.cache.runtime
Class AbstractCache
- java.lang.Object
-
- io.quarkus.cache.runtime.AbstractCache
-
- All Implemented Interfaces:
Cache
- Direct Known Subclasses:
CaffeineCache,NoOpCache
public abstract class AbstractCache extends Object implements Cache
-
-
Field Summary
Fields Modifier and Type Field Description static StringNULL_KEYS_NOT_SUPPORTED_MSG
-
Constructor Summary
Constructors Constructor Description AbstractCache()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract CompletableFuture<Object>get(Object key, Function<Object,Object> valueLoader)ObjectgetDefaultKey()Returns the unique and immutable default key for the current cache.abstract StringgetName()abstract voidinvalidate(Object key)abstract voidinvalidateAll()abstract io.smallrye.mutiny.Uni<Void>replaceUniValue(Object key, Object emittedValue)Replaces the cache value associated with the given key by an item emitted by aUni.
-
-
-
Field Detail
-
NULL_KEYS_NOT_SUPPORTED_MSG
public static final String NULL_KEYS_NOT_SUPPORTED_MSG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public abstract String getName()
-
getDefaultKey
public Object getDefaultKey()
Returns the unique and immutable default key for the current cache. This key is used by the annotations caching API when a no-args method annotated withCacheResultorCacheInvalidateis invoked.- Returns:
- default cache key
-
get
public abstract CompletableFuture<Object> get(Object key, Function<Object,Object> valueLoader)
-
invalidate
public abstract void invalidate(Object key)
-
invalidateAll
public abstract void invalidateAll()
-
replaceUniValue
public abstract io.smallrye.mutiny.Uni<Void> replaceUniValue(Object key, Object emittedValue)
Replaces the cache value associated with the given key by an item emitted by aUni. This method can be called several times for the same key, each call will then always replace the existing cache entry with the given emitted value. If the key no longer identifies a cache entry, this method must not put the emitted item into the cache.
-
-