Do any of you know of a Java Map or similar standard data store that automatically purges entries after a given timeout? Preferably in an open source library that is accessible via maven?
I know of ways to implement the functionality myself and have done it several times in the past, so I'm not asking for advice in that respect, but for pointers to a good reference implementation.
WeakReference based solutions like WeakHashMap are not an option, because my keys are likely to be non-interned strings and I want a configurable timeout that's not dependent on the garbage collector.
Ehcache is also an option I wouldn't like to rely on because it needs external configuration files. I am looking for a code-only solution.