I have a javax.cache.Cache instance, where after 10 mins of inactivity the entries are being automatically removed. Without going into much depth, is there a configuration parameter which automatically removes key value pair from the cache?
Heres the code snippet
@Produces
@FileRicAdapterService
public EventCacheFile getNamedEventsCache(InjectionPoint injectionPoint) {
Cache<String, CachedRecord> cache = getPersistentCacheManager()
.getCache("filetoric");
return new EventCacheFileImpl(cache);
}
@Produces
public CacheManager getPersistentCacheManager() {
return new CacheManagerAdapter(
getCacheContainer(Constants.PERSISTENT_CACHE));
}
private EmbeddedCacheManager getCacheContainer(String name) {
String jndiName = "java:jboss/infinispan/container/" + name;
try {
return (EmbeddedCacheManager) new InitialContext().lookup(jndiName);
} catch (NamingException e) {
logger.fatal("Cache container not found: %s", name);
throw new UnsatisfiedResolutionException(
"Cache container not found " + name);
}
}