Class CaffeineCache

  • All Implemented Interfaces:
    Cache

    public class CaffeineCache
    extends AbstractCache
    This class is an internal Quarkus cache implementation. Do not use it explicitly from your Quarkus application. The public methods signatures may change without prior notice.
    • Method Detail

      • get

        public CompletableFuture<Object> get​(Object key,
                                             Function<Object,​Object> valueLoader)
        Returns a CompletableFuture holding the cache value identified by key, obtaining that value from valueLoader if necessary. The value computation is done synchronously on the calling thread and the CompletableFuture is immediately completed before being returned.
        Specified by:
        get in class AbstractCache
        Parameters:
        key - cache key
        valueLoader - function used to compute the cache value if key is not already associated with a value
        Returns:
        a CompletableFuture holding the cache value
        Throws:
        CacheException - if an exception is thrown during the cache value computation
      • replaceUniValue

        public io.smallrye.mutiny.Uni<Void> replaceUniValue​(Object key,
                                                            Object emittedValue)
        Description copied from class: AbstractCache
        Replaces the cache value associated with the given key by an item emitted by a Uni. 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.
        Specified by:
        replaceUniValue in class AbstractCache
      • getInitialCapacity

        public Integer getInitialCapacity()
      • getMaximumSize

        public Long getMaximumSize()
      • getExpireAfterWrite

        public Duration getExpireAfterWrite()
      • getExpireAfterAccess

        public Duration getExpireAfterAccess()
      • getSize

        public long getSize()