Class CacheSupport<K,​V>

  • All Implemented Interfaces:
    ConcurrentMap<K,​V>, Map<K,​V>, org.infinispan.commons.api.AsyncCache<K,​V>, org.infinispan.commons.api.BasicCache<K,​V>, org.infinispan.commons.api.Lifecycle

    public abstract class CacheSupport<K,​V>
    extends Object
    implements org.infinispan.commons.api.BasicCache<K,​V>
    Since:
    4.1
    Author:
    Mircea.Markus@jboss.com
    • Field Detail

      • defaultLifespan

        protected long defaultLifespan
      • defaultMaxIdleTime

        protected long defaultMaxIdleTime
    • Constructor Detail

      • CacheSupport

        protected CacheSupport()
      • CacheSupport

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

      • put

        public final V put​(K key,
                           V value)
        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
      • putAll

        public final void putAll​(Map<? extends K,​? extends V> map)
        Specified by:
        putAll in interface Map<K,​V>
      • putAsync

        public final CompletableFuture<V> putAsync​(K key,
                                                   V value)
        Specified by:
        putAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • putAsync

        public final CompletableFuture<V> putAsync​(K key,
                                                   V value,
                                                   long lifespan,
                                                   TimeUnit unit)
        Specified by:
        putAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • putAllAsync

        public final CompletableFuture<Void> putAllAsync​(Map<? extends K,​? extends V> data)
        Specified by:
        putAllAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • putAllAsync

        public final CompletableFuture<Void> putAllAsync​(Map<? extends K,​? extends V> data,
                                                         long lifespan,
                                                         TimeUnit unit)
        Specified by:
        putAllAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • putIfAbsentAsync

        public final CompletableFuture<V> putIfAbsentAsync​(K key,
                                                           V value)
        Specified by:
        putIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • putIfAbsentAsync

        public final CompletableFuture<V> putIfAbsentAsync​(K key,
                                                           V value,
                                                           long lifespan,
                                                           TimeUnit unit)
        Specified by:
        putIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • replaceAsync

        public final CompletableFuture<V> replaceAsync​(K key,
                                                       V value,
                                                       long lifespan,
                                                       TimeUnit unit)
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • replaceAsync

        public final CompletableFuture<Boolean> replaceAsync​(K key,
                                                             V oldValue,
                                                             V newValue)
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • replaceAsync

        public final CompletableFuture<V> replaceAsync​(K key,
                                                       V value)
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • replaceAsync

        public final CompletableFuture<Boolean> replaceAsync​(K key,
                                                             V oldValue,
                                                             V newValue,
                                                             long lifespan,
                                                             TimeUnit unit)
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • put

        public final V put​(K key,
                           V value,
                           long lifespan,
                           TimeUnit unit)
        Specified by:
        put in interface org.infinispan.commons.api.BasicCache<K,​V>
      • putIfAbsent

        public final V putIfAbsent​(K key,
                                   V value,
                                   long lifespan,
                                   TimeUnit unit)
        Specified by:
        putIfAbsent in interface org.infinispan.commons.api.BasicCache<K,​V>
      • putAll

        public final void putAll​(Map<? extends K,​? extends V> map,
                                 long lifespan,
                                 TimeUnit unit)
        Specified by:
        putAll in interface org.infinispan.commons.api.BasicCache<K,​V>
      • replace

        public final V replace​(K key,
                               V value,
                               long lifespan,
                               TimeUnit unit)
        Specified by:
        replace in interface org.infinispan.commons.api.BasicCache<K,​V>
      • replace

        public final boolean replace​(K key,
                                     V oldValue,
                                     V newValue)
        Specified by:
        replace in interface ConcurrentMap<K,​V>
        Specified by:
        replace in interface Map<K,​V>
      • replace

        public final boolean replace​(K key,
                                     V oldValue,
                                     V value,
                                     long lifespan,
                                     TimeUnit unit)
        Specified by:
        replace in interface org.infinispan.commons.api.BasicCache<K,​V>
      • merge

        public final V merge​(K key,
                             V value,
                             BiFunction<? super V,​? super V,​? extends V> remappingFunction,
                             long lifespan,
                             TimeUnit lifespanUnit)
        Specified by:
        merge in interface org.infinispan.commons.api.BasicCache<K,​V>