I need a thread-safe Map with a time limited expiry policy. I tried looking for an existing library, but could not find one. Jboss cache is going to be a heavy alternative for my requirement. I have a first cut draft in place. Please have a look at the code posted on pastebin
I need constructive comments and enhancement suggestions. Thanks in advance.
Take a look at Guava MapMaker:
http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html
It does exactly what you are looking for.