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

public class RefreshableCachedObject<T extends Refreshable> extends CachedObject<T>
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:
  • Constructor Details

    • RefreshableCachedObject

      public RefreshableCachedObject(T object)
    • RefreshableCachedObject

      public RefreshableCachedObject(T object, long expires)
  • 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)