Class LoadingCacheProxy<K,V>

java.lang.Object
com.github.benmanes.caffeine.jcache.CacheProxy<K,V>
com.github.benmanes.caffeine.jcache.LoadingCacheProxy<K,V>
All Implemented Interfaces:
Closeable, AutoCloseable, 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.
  • Field Details

  • Constructor Details

  • Method Details

    • 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 Map<K,V> getAll(Set<? extends K> keys)
      Specified by:
      getAll in interface javax.cache.Cache<K,V>
      Overrides:
      getAll in class CacheProxy<K,V>
    • getAll

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

      public void loadAll(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>