How to fetch all the elements in a MemoryStore of an existing cache [EHCache]

215 Views Asked by At

I'm new to EHCache. I have implemented EHCache for my application. I have configured all the cache configuration's. I found that in my cache's MemoryStore there are certain number of elements existing in it. I would like to fetch them all for further manipulation. Could anyone help me out as to how to access elements in MemoryStore of my existing cache.

Thank You in Advance.

2

There are 2 best solutions below

1
On

Here is a snippet to get you started:

cacheKeys = CacheInfo.getCacheKeys();
cacheKeys.forEach((String k) -> {

});
1
On

There is no public API to access elements of a specific store in Ehcache. The whole point of the store system is to improve read performance, in a transparent fashion.