资 源 简 介
Draagon Expiring Cache
This is a simple cache mechanism that uses an underlying ConcurrentHashMap and a CacheManager to expire cache entries based on a configurable amount of time. The CacheManager is single threaded and manages all Cache instances and is optimized for minimal processing time. The Cache object implements the Map interface for easy compatibility, simply replace your Map construction with a Cache object to get the expiring functionality.
Usage
```
int TIMEOUT_SECONDS = 180;
int CHECK_SECONDS = 30;
Cache c = new Cache( TIMEOUTSECONDS, CHECKSECONDS );
c.put( "test", "me" );
assertTrue( c.get("test") != null );
Thread.sleep( 181000L );
assertTrue( c.get( "test") == null );
```
Maven
To include with Maven, use one or more of the following dependencies:
com.draagon