Class UnblockingRemovalJvmCache<K,V>

java.lang.Object
com.atlassian.confluence.impl.vcache.UnblockingRemovalJvmCache<K,V>

@Internal public final class UnblockingRemovalJvmCache<K,V> extends Object
JVM Cache that can be cleared without blocking.

Unlike normal JvmCache, this cache will not block when it is cleared while a value is being generated. It has the following properties:

  • At most one thread can generate value for a key concurrently.
  • Generated value will be returned to the current thread even if the cache was cleared during the value generation.
Since:
5.10.1
  • Constructor Details

    • UnblockingRemovalJvmCache

      public UnblockingRemovalJvmCache(com.atlassian.vcache.VCacheFactory cacheFactory, String name, com.atlassian.vcache.JvmCacheSettings settings)
  • Method Details

    • get

      public @NonNull V get(K key, Supplier<? extends V> supplier)
    • removeAll

      public void removeAll()