Class RemoteCacheSupport<K,​V>

  • All Implemented Interfaces:
    ConcurrentMap<K,​V>, Map<K,​V>, RemoteCache<K,​V>, org.infinispan.commons.api.AsyncCache<K,​V>, org.infinispan.commons.api.BasicCache<K,​V>, org.infinispan.commons.api.Lifecycle, org.infinispan.commons.api.TransactionalCache
    Direct Known Subclasses:
    RemoteCacheImpl

    public abstract class RemoteCacheSupport<K,​V>
    extends Object
    implements RemoteCache<K,​V>
    Purpose: keep all delegating and unsupported methods in one place -> readability.
    Since:
    4.1
    Author:
    Mircea.Markus@jboss.com
    • Field Detail

      • defaultLifespan

        protected long defaultLifespan
      • defaultMaxIdleTime

        protected long defaultMaxIdleTime
    • Constructor Detail

      • RemoteCacheSupport

        protected RemoteCacheSupport()
      • RemoteCacheSupport

        protected RemoteCacheSupport​(long defaultLifespan,
                                     long defaultMaxIdleTime)
    • Method Detail

      • putAll

        public void putAll​(Map<? extends K,​? extends V> map,
                           long lifespan,
                           TimeUnit unit)
        Description copied from interface: RemoteCache
        Synthetic operation. The client iterates over the set of keys and calls put for each one of them. This results in operation not being atomic (if a failure happens after few puts it is not rolled back) and costly (for each key in the parameter map a remote call is performed).
        Specified by:
        putAll in interface org.infinispan.commons.api.BasicCache<K,​V>
        Specified by:
        putAll in interface RemoteCache<K,​V>
        Parameters:
        map - map containing mappings to enter
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        unit - unit of measurement for the lifespan
      • putIfAbsent

        public V putIfAbsent​(K key,
                             V value,
                             long lifespan,
                             TimeUnit unit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters.
        Specified by:
        putIfAbsent in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        unit - unit of measurement for the lifespan
        Returns:
        the value being replaced, or null if nothing is being replaced.
      • putIfAbsent

        public V putIfAbsent​(K key,
                             V value,
                             long lifespan,
                             TimeUnit lifespanUnit,
                             long maxIdleTime,
                             TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters.
        Specified by:
        putIfAbsent in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the value being replaced, or null if nothing is being replaced.
      • replace

        public final V replace​(K key,
                               V value,
                               long lifespan,
                               TimeUnit unit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.replace(Object, Object), which takes in lifespan parameters.
        Specified by:
        replace in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        unit - unit of measurement for the lifespan
        Returns:
        the value being replaced, or null if nothing is being replaced.
      • replace

        public V replace​(K key,
                         V value,
                         long lifespan,
                         TimeUnit lifespanUnit,
                         long maxIdleTime,
                         TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.replace(Object, Object), which takes in lifespan parameters.
        Specified by:
        replace in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the value being replaced, or null if nothing is being replaced.
      • put

        public V put​(K key,
                     V value)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        If the return value of this operation will be ignored by the application, the user is strongly encouraged to use the Flag.IGNORE_RETURN_VALUES flag when invoking this method in order to make it behave as efficiently as possible (i.e. avoiding needless remote or network calls).
        Specified by:
        put in interface org.infinispan.commons.api.BasicCache<K,​V>
        Specified by:
        put in interface Map<K,​V>
      • set

        protected abstract void set​(K key,
                                    V value)
        This is intentionally a non-public method meant as an integration point for bytecode manipulation. Don't remove or alter the signature even if it might look like unreachable code. Implementors should perform a put operation but optimizing it as return values are not required.
        Since:
        5.0
      • putAsync

        public final CompletableFuture<V> putAsync​(K key,
                                                   V value)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.put(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        putAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        Returns:
        a future containing the old value replaced.
      • putAsync

        public CompletableFuture<V> putAsync​(K key,
                                             V value,
                                             long lifespan,
                                             TimeUnit unit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.put(Object, Object, long, TimeUnit) . This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        putAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of entry
        unit - time unit for lifespan
        Returns:
        a future containing the old value replaced
      • replaceWithVersion

        public boolean replaceWithVersion​(K key,
                                          V newValue,
                                          long version,
                                          int lifespanSeconds)
        Description copied from interface: RemoteCache
        A overloaded form of RemoteCache.replaceWithVersion(Object, Object, long) which takes in lifespan parameters.
        Specified by:
        replaceWithVersion in interface RemoteCache<K,​V>
        Parameters:
        key - key to use
        newValue - new value to be associated with the key
        version - numeric version that should match the one in the server for the operation to succeed
        lifespanSeconds - lifespan of the entry
        Returns:
        true if the value was replaced
      • replaceAsync

        public CompletableFuture<V> replaceAsync​(K key,
                                                 V value)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.replace(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        value - value to store
        Returns:
        a future containing the previous value overwritten
      • put

        public V put​(K key,
                     V value,
                     long lifespan,
                     TimeUnit unit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of BasicCache.put(Object, Object), which takes in lifespan parameters.
        Specified by:
        put in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        unit - unit of measurement for the lifespan
        Returns:
        the value being replaced, or null if nothing is being replaced.
      • put

        public V put​(K key,
                     V value,
                     long lifespan,
                     TimeUnit lifespanUnit,
                     long maxIdleTime,
                     TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of BasicCache.put(Object, Object), which takes in lifespan parameters.
        Specified by:
        put in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the value being replaced, or null if nothing is being replaced.
      • putIfAbsentAsync

        public CompletableFuture<V> putIfAbsentAsync​(K key,
                                                     V value)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.putIfAbsent(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        putIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        Returns:
        a future containing the old value replaced.
      • putIfAbsentAsync

        public CompletableFuture<V> putIfAbsentAsync​(K key,
                                                     V value,
                                                     long lifespan,
                                                     TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.putIfAbsent(Object, Object, long, TimeUnit) . This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        putIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of entry
        lifespanUnit - time unit for lifespan
        Returns:
        a future containing the old value replaced
      • putIfAbsentAsync

        public CompletableFuture<V> putIfAbsentAsync​(K key,
                                                     V value,
                                                     long lifespan,
                                                     TimeUnit lifespanUnit,
                                                     long maxIdle,
                                                     TimeUnit maxIdleUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        putIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of entry
        lifespanUnit - time unit for lifespan
        maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleUnit - time unit for max idle time
        Returns:
        a future containing the old value replaced
      • removeAsync

        public CompletableFuture<Boolean> removeAsync​(Object key,
                                                      Object value)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.remove(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        removeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        value - value to match on
        Returns:
        a future containing a boolean, indicating whether the entry was removed or not
      • replaceAsync

        public CompletableFuture<V> replaceAsync​(K key,
                                                 V value,
                                                 long lifespan,
                                                 TimeUnit unit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.replace(Object, Object, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        value - value to store
        lifespan - lifespan of entry
        unit - time unit for lifespan
        Returns:
        a future containing the previous value overwritten
      • replaceAsync

        public CompletableFuture<V> replaceAsync​(K key,
                                                 V value,
                                                 long lifespan,
                                                 TimeUnit lifespanUnit,
                                                 long maxIdle,
                                                 TimeUnit maxIdleUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        value - value to store
        lifespan - lifespan of entry
        lifespanUnit - time unit for lifespan
        maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleUnit - time unit for max idle time
        Returns:
        a future containing the previous value overwritten
      • replaceAsync

        public CompletableFuture<Boolean> replaceAsync​(K key,
                                                       V oldValue,
                                                       V newValue)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.replace(Object, Object, Object). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        oldValue - value to overwrite
        newValue - value to store
        Returns:
        a future containing a boolean, indicating whether the entry was replaced or not
      • replaceAsync

        public CompletableFuture<Boolean> replaceAsync​(K key,
                                                       V oldValue,
                                                       V newValue,
                                                       long lifespan,
                                                       TimeUnit unit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.replace(Object, Object, Object, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        oldValue - value to overwrite
        newValue - value to store
        lifespan - lifespan of entry
        unit - time unit for lifespan
        Returns:
        a future containing a boolean, indicating whether the entry was replaced or not
      • replaceAsync

        public CompletableFuture<Boolean> replaceAsync​(K key,
                                                       V oldValue,
                                                       V newValue,
                                                       long lifespan,
                                                       TimeUnit lifespanUnit,
                                                       long maxIdle,
                                                       TimeUnit maxIdleUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.replace(Object, Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Parameters:
        key - key to remove
        oldValue - value to overwrite
        newValue - value to store
        lifespan - lifespan of entry
        lifespanUnit - time unit for lifespan
        maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleUnit - time unit for max idle time
        Returns:
        a future containing a boolean, indicating whether the entry was replaced or not
      • replace

        public boolean replace​(K key,
                               V oldValue,
                               V value,
                               long lifespan,
                               TimeUnit lifespanUnit,
                               long maxIdleTime,
                               TimeUnit maxIdleTimeUnit)
        Description copied from interface: RemoteCache
        An overloaded form of ConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters.

        This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use RemoteCache.getWithMetadata(Object) and RemoteCache.replaceWithVersion(Object, Object, long, long, TimeUnit, long, TimeUnit) if possible.

        Specified by:
        replace in interface org.infinispan.commons.api.BasicCache<K,​V>
        Specified by:
        replace in interface RemoteCache<K,​V>
        Parameters:
        key - key to use
        oldValue - value to replace
        value - value to store
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        true if the value was replaced, false otherwise
      • merge

        public V merge​(K key,
                       V value,
                       BiFunction<? super V,​? super V,​? extends V> remappingFunction,
                       long lifespan,
                       TimeUnit lifespanUnit,
                       long maxIdleTime,
                       TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.merge(Object, Object, BiFunction) which takes in lifespan parameters.
        Specified by:
        merge in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - new value to merge with existing value
        remappingFunction - function to use to merge new and existing values into a merged value to store under key
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the merged value that was stored under key
      • merge

        public V merge​(K key,
                       V value,
                       BiFunction<? super V,​? super V,​? extends V> remappingFunction,
                       long lifespan,
                       TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.merge(Object, Object, BiFunction) which takes in lifespan parameters.
        Specified by:
        merge in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        value - new value to merge with existing value
        remappingFunction - function to use to merge new and existing values into a merged value to store under key
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        Returns:
        the merged value that was stored under key
      • computeAsync

        public CompletableFuture<V> computeAsync​(K key,
                                                 BiFunction<? super K,​? super V,​? extends V> remappingFunction)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.compute(Object, BiFunction). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeIfAbsentAsync

        public CompletableFuture<V> computeIfAbsentAsync​(K key,
                                                         Function<? super K,​? extends V> mappingFunction)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.computeIfAbsent(Object, Function). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeIfPresentAsync

        public CompletableFuture<V> computeIfPresentAsync​(K key,
                                                          BiFunction<? super K,​? super V,​? extends V> remappingFunction)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.computeIfPresent(Object, BiFunction). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeIfPresentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • compute

        public V compute​(K key,
                         BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                         long lifespan,
                         TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.compute(Object, BiFunction) which takes in lifespan parameters.
        Specified by:
        compute in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        remappingFunction - function to use to compute and store the value under key
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        Returns:
        the computed value that was stored under key
      • compute

        public V compute​(K key,
                         BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                         long lifespan,
                         TimeUnit lifespanUnit,
                         long maxIdleTime,
                         TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.compute(Object, BiFunction) which takes in lifespan and maxIdleTime parameters.
        Specified by:
        compute in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        remappingFunction - function to use to compute and store the value under key
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the computed value that was stored under key
      • computeIfPresent

        public V computeIfPresent​(K key,
                                  BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                  long lifespan,
                                  TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.computeIfPresent(Object, BiFunction) which takes in lifespan parameters.
        Specified by:
        computeIfPresent in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        remappingFunction - function to use to compute and store the value under key, if such exists
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        Returns:
        the computed value that was stored under key
      • computeIfPresent

        public V computeIfPresent​(K key,
                                  BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                  long lifespan,
                                  TimeUnit lifespanUnit,
                                  long maxIdleTime,
                                  TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.computeIfPresent(Object, BiFunction) which takes in lifespan and maxIdleTime parameters.
        Specified by:
        computeIfPresent in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        remappingFunction - function to use to compute and store the value under key, if such exists
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the computed value that was stored under key
      • computeIfAbsent

        public V computeIfAbsent​(K key,
                                 Function<? super K,​? extends V> mappingFunction,
                                 long lifespan,
                                 TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.computeIfAbsent(Object, Function) which takes in lifespan parameters.
        Specified by:
        computeIfAbsent in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        mappingFunction - function to use to compute and store the value under key, if the key is absent
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        Returns:
        the computed value that was stored under key
      • computeIfAbsent

        public V computeIfAbsent​(K key,
                                 Function<? super K,​? extends V> mappingFunction,
                                 long lifespan,
                                 TimeUnit lifespanUnit,
                                 long maxIdleTime,
                                 TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.BasicCache
        An overloaded form of ConcurrentMap.computeIfAbsent(Object, Function) which takes in lifespan and maxIdleTime parameters.
        Specified by:
        computeIfAbsent in interface org.infinispan.commons.api.BasicCache<K,​V>
        Parameters:
        key - key to use
        mappingFunction - function to use to compute and store the value under key, if the key is absent
        lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        the computed value that was stored under key
      • computeAsync

        public CompletableFuture<V> computeAsync​(K key,
                                                 BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                                 long lifespan,
                                                 TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.compute(Object, BiFunction, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeAsync

        public CompletableFuture<V> computeAsync​(K key,
                                                 BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                                 long lifespan,
                                                 TimeUnit lifespanUnit,
                                                 long maxIdle,
                                                 TimeUnit maxIdleUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.compute(Object, BiFunction, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeIfAbsentAsync

        public CompletableFuture<V> computeIfAbsentAsync​(K key,
                                                         Function<? super K,​? extends V> mappingFunction,
                                                         long lifespan,
                                                         TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.computeIfAbsent(Object, Function, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeIfAbsentAsync

        public CompletableFuture<V> computeIfAbsentAsync​(K key,
                                                         Function<? super K,​? extends V> mappingFunction,
                                                         long lifespan,
                                                         TimeUnit lifespanUnit,
                                                         long maxIdle,
                                                         TimeUnit maxIdleUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.computeIfAbsent(Object, Function, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeIfPresentAsync

        public CompletableFuture<V> computeIfPresentAsync​(K key,
                                                          BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                                          long lifespan,
                                                          TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.computeIfPresent(Object, BiFunction, long, TimeUnit) . This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeIfPresentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • computeIfPresentAsync

        public CompletableFuture<V> computeIfPresentAsync​(K key,
                                                          BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                                          long lifespan,
                                                          TimeUnit lifespanUnit,
                                                          long maxIdle,
                                                          TimeUnit maxIdleUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.computeIfPresent(Object, BiFunction, long, TimeUnit, long, TimeUnit) . This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        computeIfPresentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • mergeAsync

        public CompletableFuture<V> mergeAsync​(K key,
                                               V value,
                                               BiFunction<? super V,​? super V,​? extends V> remappingFunction)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of ConcurrentMap.merge(Object, Object, BiFunction). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        mergeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • mergeAsync

        public CompletableFuture<V> mergeAsync​(K key,
                                               V value,
                                               BiFunction<? super V,​? super V,​? extends V> remappingFunction,
                                               long lifespan,
                                               TimeUnit lifespanUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.merge(Object, Object, BiFunction, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        mergeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • mergeAsync

        public CompletableFuture<V> mergeAsync​(K key,
                                               V value,
                                               BiFunction<? super V,​? super V,​? extends V> remappingFunction,
                                               long lifespan,
                                               TimeUnit lifespanUnit,
                                               long maxIdleTime,
                                               TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.merge(Object, Object, BiFunction, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        mergeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>