Javadoc
CacheRepository is a
Repository implementation that wraps another
Repository and acts as a write-through cache of
Subjects and
schema to id mappings, shielding the inner
Repository from repetitive
lookups.
CacheRepository can cache Subjects (which cannot be deleted) and returns an
implementation of
Subject that caches schema to id mappings.
CacheRepository can only cache the immutable elements of a Repository, because
it is intended for use in any context -- in a client, in a proxy, or above a raw
implementation of a repository.
It cannot cache the entire list of subjects since the list is mutable.
Similarly, a cached subject cannot cache the list of schemas, the subject configuration,
or the latest() schema because those are mutable.