Interface StateRepository


  • public interface StateRepository
    A repository allowing to preserve state in the context of a Cache.
    • Method Detail

      • getPersistentStateHolder

        @Deprecated
        default <K extends java.io.Serializable,​V extends java.io.Serializable> StateHolder<K,​V> getPersistentStateHolder​(java.lang.String name,
                                                                                                                                      java.lang.Class<K> keyClass,
                                                                                                                                      java.lang.Class<V> valueClass)
        Deprecated.
        Replaced by getPersistentStateHolder(String, Class, Class, Predicate, ClassLoader) that takes in a Predicate that authorizes a class for deserialization
        Gets a named state holder rooted in the current StateRepository.

        If the state holder existed already, it is returned with its content fully available.

        Type Parameters:
        K - the key type, must be Serializable
        V - the value type, must be Serializable
        Parameters:
        name - the state holder name
        keyClass - concrete key type
        valueClass - concrete value type
        Returns:
        a state holder
      • getPersistentStateHolder

        <K extends java.io.Serializable,​V extends java.io.Serializable> StateHolder<K,​V> getPersistentStateHolder​(java.lang.String name,
                                                                                                                              java.lang.Class<K> keyClass,
                                                                                                                              java.lang.Class<V> valueClass,
                                                                                                                              java.util.function.Predicate<java.lang.Class<?>> isClassPermitted,
                                                                                                                              java.lang.ClassLoader classLoader)
        Gets a named state holder rooted in the current StateRepository.

        If the state holder existed already, it is returned with its content fully available.

        Type Parameters:
        K - the key type, must be Serializable
        V - the value type, must be Serializable
        Parameters:
        name - the state holder name
        keyClass - concrete key type
        valueClass - concrete value type
        isClassPermitted - Predicate that determines whether a class is authorized for deserialization as part of key or value deserialization
        classLoader - class loader used at the time of deserialization of key and value
        Returns:
        a state holder