SelfPopulatingCache
is available in Ehcache version 2.8
but not in version 3.2
. Is there something that gives the same functionality in version 3.2
?
Ehcache 3.x does not reproduce this concept directly.
However you can perfectly achieve the same result by using a CacheLoaderWriter
.
Simply ignore the write-through part by having no-op implementations and implement the load
and loadAll
method to perform the logic you find in the Ehcache 2.x CacheEntryFactory
.
-
Not quite the same if you care about cache statistics. When using a CacheLoaderWriter, statistics will always report a 100% hit rate. – chuckd Aug 28 '20 at 11:36