Package com.easydesk.cache
Class RefreshableCachedObject<T extends Refreshable>
java.lang.Object
com.easydesk.cache.CachedObject<T>
com.easydesk.cache.RefreshableCachedObject<T>
- Type Parameters:
T- the type of the wrapped, refreshable object
- All Implemented Interfaces:
Serializable
A
CachedObject that refreshes itself instead of being evicted when
it goes stale. A Time-To-Live (TTL) controls how long it may sit untouched
before it is removed regardless.
Ported unchanged (aside from package) from Apache Fulcrum's
org.apache.fulcrum.cache.RefreshableCachedObject.
- See Also:
-
Field Summary
Fields inherited from class com.easydesk.cache.CachedObject
created, DEFAULT, FOREVER -
Constructor Summary
ConstructorsConstructorDescriptionRefreshableCachedObject(T object) RefreshableCachedObject(T object, long expires) -
Method Summary
Modifier and TypeMethodDescriptionlonglonggetTTL()booleanvoidrefresh()voidsetLastAccess(long lastAccess) voidsetTTL(long timeToLive) voidtouch()Methods inherited from class com.easydesk.cache.CachedObject
getContents, getCreated, getExpires, isStale, setExpires, setStale
-
Constructor Details
-
RefreshableCachedObject
-
RefreshableCachedObject
-
-
Method Details
-
setTTL
public void setTTL(long timeToLive) -
getTTL
public long getTTL() -
touch
public void touch() -
isUntouched
public boolean isUntouched() -
refresh
public void refresh() -
getLastAccess
public long getLastAccess() -
setLastAccess
public void setLastAccess(long lastAccess)
-