Chapter 16. Cache Loaders
The cache loader provides Red Hat JBoss Data Grid's connection to a persistent data store. The cache loader retrieves data from a data store when the required data is not present in the cache. If a cache loader is extended, it can be used as a cache store and can copy the modified data to the data store.
Cache loaders are associated with individual caches. Different caches attached to the same cache manager can have different cache store configurations.
16.1. Cache Loaders and Cache Stores
JBoss Cache originally shipped with a
CacheLoader
interface and a number of implementations. Red Hat JBoss Data Grid has divided these into two distinct interfaces, a CacheLoader
and a CacheStore
. The CacheLoader
loads a previously existing state from another location, while the CacheStore
(which extends CacheLoader
) exposes methods to store states as well as loading them. This division allows easier definition of read-only sources.
JBoss Data Grid ships with several high performance implementations of these interfaces.