Class LoadingCacheProxy<K,​V>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<javax.cache.Cache.Entry<K,​V>>, javax.cache.Cache<K,​V>

    public final class LoadingCacheProxy<K,​V>
    extends CacheProxy<K,​V>
    An implementation of JSR-107 Cache backed by a Caffeine loading cache.
    • Method Detail

      • get

        public @Nullable V get​(K key)
        Specified by:
        get in interface javax.cache.Cache<K,​V>
        Overrides:
        get in class CacheProxy<K,​V>
      • getOrLoad

        private @Nullable V getOrLoad​(K key)
        Retrieves the value from the cache, loading it if necessary.
      • getAll

        public java.util.Map<K,​V> getAll​(java.util.Set<? extends K> keys)
        Specified by:
        getAll in interface javax.cache.Cache<K,​V>
        Overrides:
        getAll in class CacheProxy<K,​V>
      • getAll

        private java.util.Map<K,​V> getAll​(java.util.Set<? extends K> keys,
                                                boolean updateAccessTime)
        Returns the entries, loading if necessary, and optionally updates their access expiry time.
      • loadAll

        public void loadAll​(java.util.Set<? extends K> keys,
                            boolean replaceExistingValues,
                            javax.cache.integration.CompletionListener completionListener)
        Specified by:
        loadAll in interface javax.cache.Cache<K,​V>
        Overrides:
        loadAll in class CacheProxy<K,​V>