Class UnboundedLocalCache.UnboundedLocalAsyncLoadingCache<K,​V>

    • Field Detail

      • mapView

        @Nullable java.util.concurrent.ConcurrentMap<K,​java.util.concurrent.CompletableFuture<V>> mapView
      • policy

        @Nullable Policy<K,​V> policy
    • Constructor Detail

    • Method Detail

      • asMap

        public java.util.concurrent.ConcurrentMap<K,​java.util.concurrent.CompletableFuture<V>> asMap()
        Description copied from interface: AsyncCache
        Returns a view of the entries stored in this cache as a thread-safe map. Modifications made to the map directly affect the cache.

        A computation operation, such as ConcurrentMap.compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>), performs the entire method invocation atomically, so the function is applied at most once per key. Some attempted update operations by other threads may be blocked while computation is in progress. The computation must not attempt to update any other mappings of this cache.

        Iterators from the returned map are at least weakly consistent: they are safe for concurrent use, but if the cache is modified (including by eviction) after the iterator is created, it is undefined which of the changes (if any) will be reflected in that iterator.

        Specified by:
        asMap in interface AsyncCache<K,​V>
        Specified by:
        asMap in interface AsyncLoadingCache<K,​V>
        Returns:
        a thread-safe view of this cache supporting all of the optional Map operations
      • readObject

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.InvalidObjectException
        Throws:
        java.io.InvalidObjectException
      • writeReplace

        java.lang.Object writeReplace()