Interface CacheLoader<K,V>

All Superinterfaces:
Lifecycle
All Known Subinterfaces:
AdvancedCacheLoader<K,V>, AdvancedLoadWriteStore<K,V>, ExternalStore<K,V>, FlagAffectedStore<K,V>, SegmentedAdvancedLoadWriteStore<K,V>
All Known Implementing Classes:
AbstractSegmentedAdvancedLoadWriteStore, ClusterLoader, ComposedSegmentedLoadWriteStore, DelegatingCacheLoader

@ThreadSafe @Deprecated(forRemoval=true) public interface CacheLoader<K,V> extends Lifecycle
Deprecated, for removal: This API element is subject to removal in a future version.
since 11.0 replaced by NonBlockingStore
Defines the logic for loading data from an external storage. The writing of data is optional and coordinated through a CacheWriter.
Since:
6.0
Author:
Mircea Markus
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the storage contains an entry associated with the given key.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Used to initialize a cache loader.
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Fetches an entry from the storage.

    Methods inherited from interface org.infinispan.commons.api.Lifecycle

    start, stop
  • Method Details

    • init

      void init(InitializationContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Used to initialize a cache loader. Typically invoked by the PersistenceManager when setting up cache loaders.
      Throws:
      PersistenceException - in case of an error, e.g. communicating with the external storage
    • loadEntry

      MarshallableEntry<K,V> loadEntry(Object key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Fetches an entry from the storage. If a MarshallableEntry needs to be created here, InitializationContext.getMarshallableEntryFactory() ()} and InitializationContext.getByteBufferFactory() should be used.
      Returns:
      the entry, or null if the entry does not exist
      Throws:
      PersistenceException - in case of an error, e.g. communicating with the external storage
    • contains

      boolean contains(Object key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the storage contains an entry associated with the given key.
      Throws:
      PersistenceException - in case of an error, e.g. communicating with the external storage
    • isAvailable

      default boolean isAvailable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      true if the writer can be connected to, otherwise false