Link to home
Create AccountLog in
Avatar of Steve Sperber
Steve SperberFlag for United States of America

asked on

How do I find a resource, resource pool, test, and expiration in ehcache 3.x, Java Apps ?

EhCache 3.x in Java 


1) we create an instance of CacheManager and specify a ResourcePoolBuilder, what does that mean? How do we choose the right number?  Why do we need it?


2) How do we verify the value is from the XML configuration file?


3) what's the best way to check if a cache value is new and not old (Expiry's working or not)?


Java Code

import org.ehcache.*;
import org.ehcache.builder.*;
import org.ehcache.core.*;


CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder().build;
cacheManager.init();
cacheManager.createCache("CacheName", CacheConfigurationBuilder.newCacheConfigurationBuilder(String.class, Long.class, ResourcePoolsBuilder.heap(100));

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of Noah
Noah
Flag of Singapore image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account