Reputation: 3287
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.
Upvotes: 3
Views: 687
Reputation: 53694
i'm sure ehcache would have something that would work. maybe a bit "lighter" than jboss cache.
Upvotes: 1
Reputation: 10215
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.
Upvotes: 6