Interface StateRepository


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

    • getPersistentStateHolder

      @Deprecated default <K extends Serializable, V extends Serializable> StateHolder<K,V> getPersistentStateHolder(String name, Class<K> keyClass, 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 Serializable, V extends Serializable> StateHolder<K,V> getPersistentStateHolder(String name, Class<K> keyClass, Class<V> valueClass, Predicate<Class<?>> isClassPermitted, 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