I’m looking for a Java framework which does basically some kind of layered caching with some actions needed between these layers.
Here is an example to explain my use case:
- I wolud like to create some graphics (img01-img05) dynamically.
- These graphics depend on a commen XML file (xml01) which is updated every few minutes (say 5min).
- img05 needs one more file (xml02) to be created
- now I want to get img01, which triggers:
- the retrieval of xml01
- and the extraction of data for the needed data for img01
- now I want to get img02, which triggers:
(the retrieval of xml01 is not needed because it is cached )- and the extraction of data for the needed data for img02
- now I want to get img05, which triggers:
(the retrieval of xml01 is not needed because it is cached )- the retrieval of xml02
- and the extraction of data for the needed data for img02
- after a few minutes goto 4)
There could be more complicated use cases than this simplified example.
Is there something which could help me with these requirements?
I would do the following:
interfacesfor getting your resources images and xml.classeswhich provide that functionalityYour code is then completely free of the caching logic and the length of time for caching can be configured by configuring the Ehcache.