|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.cache.CacheEntry
Wrapper for any Cacheable object to be stored in a cache. This wrapper provides some utility services to the cacheable object, like maintaining it's usage count (for the least-frequently-used algorithm used to free up cache space when needed) and the expiry time of the object (for caches that use timed expiry of objects - e.g. keep it cached for x seconds)
| Field Summary | |
protected long |
created
When created * |
| Constructor Summary | |
CacheEntry(Cacheable newContents)
Constructor 1 Sets the object to expire in the default time |
|
CacheEntry(Cacheable newContents,
long newExpires)
Constructor 2 |
|
| Method Summary | |
void |
clearUsedCount()
|
Cacheable |
getContents()
|
long |
getCreated()
|
long |
getExpires()
|
String |
getKey()
|
long |
getUsedCount()
Used for figuring out how often this has been used |
void |
incrementUsedCount()
|
boolean |
isExpired()
Checks if the object has expired. |
void |
setExpiration(long expiration)
Set the expiration time for the cache entry. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected long created
| Constructor Detail |
public CacheEntry(Cacheable newContents)
newContents - the Cacheable object you want to cache
public CacheEntry(Cacheable newContents,
long newExpires)
newContents - the object to cachenewExpires - how long before the object expires. In millis,
e.g. 1000 = 1 second| Method Detail |
public void clearUsedCount()
public Cacheable getContents()
public long getCreated()
public long getExpires()
public String getKey()
public long getUsedCount()
public void incrementUsedCount()
public void setExpiration(long expiration)
expiration - time in milliseconds to hold the object before it expires.public final boolean isExpired()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||