Ralph
Ralph

Reputation: 32264

Java 5 automatically expiring cache

I am looking for a caching framework that supports expiring values a specified time after the last access. It must support Java 5.

I looked at the (very-nice) Google Guava library that supports CacheBuilder, and they promise a back port to Java 5, but at the present time, it only supports 6 (in the latest build).

I know that writing a performant, thread-safe cache is a difficult task that I would rather not take on.

Upvotes: 1

Views: 823

Answers (2)

Stephen C
Stephen C

Reputation: 718708

Guava is open source. You should be able to backport the CacheBuilder class to Java 5.

Upvotes: 0

jtahlborn
jtahlborn

Reputation: 53684

ehcache is a pretty widely used java caching framework. the elements have an expiry config based on "time to idle".

Upvotes: 3

Related Questions