java - Implementing cache using Guava -


i want implement cache using guava's caching mechanism.

i have db query returns map, want cache entire map let expire after amount of time.

i realize guava caches works per-item bases. provide key, cache either returns corresponding value cache or it.

is there way use guava everything, cache timeout after time period of time , again.

many thanks

you can create instance of supplier<map<k,v>> fetches entire map database, , use suppliers.memoizewithexpiration cache it.

related:


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -