I use next one for my custom cache manager:
SimpleCacheManager cacheManager = new SimpleCacheManager();
GuavaCache myCache = new GuavaCache("telescope", CacheBuilder.newBuilder()
.expireAfterWrite(5, TimeUnit.MINUTES).build());
cacheManager.setCaches(Arrays.asList(myCache));
return cacheManager;
Now I want to use LoadingCache, because I need the method refreshAfterWrite(5, TimeUnit.MINUTES)
instead of expireAfterWrite(5, TimeUnit.MINUTES)
.
I can't put LoadingCache to GuavaCache and then set this GuavaCache into SimpleCacheManager.
Which implementations I need to use?