Class EmbeddedMultimapCache<K,​V>

  • All Implemented Interfaces:
    BasicMultimapCache<K,​V>, MultimapCache<K,​V>

    public class EmbeddedMultimapCache<K,​V>
    extends Object
    implements MultimapCache<K,​V>
    Embedded implementation of MultimapCache


    EmbeddedMultimapCache supports implicit transactions without blocking. The following methods block when they are called in a explicit transaction context. This limitation could be improved in the following versions if technically possible : More about transactions in : the Infinispan Documentation.


    The current implementation does not support duplicate values on keys. Object.equals(Object) method is used to check if a value is already present in the key. This means that the following code.
        multimapCache.put("k", "v1").join();
        multimapCache.put("k", "v2").join();
        multimapCache.put("k", "v2").join();
        multimapCache.put("k", "v2").join();
        multimapCache.get("k").thenAccept(values -> System.out.println(values.size()));
        // prints the value 2. "k" -> ["v1", "v2"]
    Katia Aresti,