Class CaffeineNearCache<K,V>

java.lang.Object
org.wildfly.clustering.cache.infinispan.remote.near.CaffeineNearCache<K,V>
Type Parameters:
K - cache key type
V - cache value type
All Implemented Interfaces:
Iterable<Map.Entry<K, org.infinispan.client.hotrod.MetadataValue<V>>>, org.infinispan.client.hotrod.near.NearCache<K,V>

public class CaffeineNearCache<K,V> extends Object implements org.infinispan.client.hotrod.near.NearCache<K,V>
Near cache implementation based on a Caffeine cache.
Author:
Paul Ferraro
  • Constructor Summary

    Constructors
    Constructor
    Description
    CaffeineNearCache(com.github.benmanes.caffeine.cache.Cache<K, org.infinispan.client.hotrod.MetadataValue<V>> cache)
    Creates a near cache backed by a Caffeine cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    org.infinispan.client.hotrod.MetadataValue<V>
    get(K key)
     
    Iterator<Map.Entry<K, org.infinispan.client.hotrod.MetadataValue<V>>>
     
    boolean
    putIfAbsent(K key, org.infinispan.client.hotrod.MetadataValue<V> value)
     
    boolean
    remove(K key)
     
    boolean
    remove(K key, org.infinispan.client.hotrod.MetadataValue<V> value)
     
    boolean
    replace(K key, org.infinispan.client.hotrod.MetadataValue<V> prevValue, org.infinispan.client.hotrod.MetadataValue<V> newValue)
     
    int
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface Iterable

    forEach, spliterator
  • Constructor Details

    • CaffeineNearCache

      public CaffeineNearCache(com.github.benmanes.caffeine.cache.Cache<K, org.infinispan.client.hotrod.MetadataValue<V>> cache)
      Creates a near cache backed by a Caffeine cache.
      Parameters:
      cache - a Caffeine cache
  • Method Details

    • putIfAbsent

      public boolean putIfAbsent(K key, org.infinispan.client.hotrod.MetadataValue<V> value)
      Specified by:
      putIfAbsent in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • remove

      public boolean remove(K key)
      Specified by:
      remove in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • remove

      public boolean remove(K key, org.infinispan.client.hotrod.MetadataValue<V> value)
      Specified by:
      remove in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • replace

      public boolean replace(K key, org.infinispan.client.hotrod.MetadataValue<V> prevValue, org.infinispan.client.hotrod.MetadataValue<V> newValue)
      Specified by:
      replace in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • get

      public org.infinispan.client.hotrod.MetadataValue<V> get(K key)
      Specified by:
      get in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • size

      public int size()
      Specified by:
      size in interface org.infinispan.client.hotrod.near.NearCache<K,V>
    • iterator

      public Iterator<Map.Entry<K, org.infinispan.client.hotrod.MetadataValue<V>>> iterator()
      Specified by:
      iterator in interface Iterable<K>