public interface RefreshController<T>
Modifier and Type | Method and Description |
---|---|
long |
calculateNextRefreshTime(T _oldObject,
T _newObject,
long _timeOfLastRefresh,
long now)
Return time of next refresh (expiry time) in milliseconds since epoch.
|
long calculateNextRefreshTime(T _oldObject, T _newObject, long _timeOfLastRefresh, long now)
Long.MAX_VALUE
is returned it means
there is no specific expiry time known or needed. In this case a reasonable
default can be assumed for the expiry, the cache will use the
configured expiry time._oldObject
- the value currently in the cache. null if it is not
in the cache, is a null value (null is supported for values)
or the previous fetch operation yielded in an exception._timeOfLastRefresh
- time of the last cache refresh, a put or a fetch
from the cache source._newObject
- the value which will be put in the cache.now
- this is the current time in millis. If a cache source was used to
fetch the value, this is the time before the fetch was started.cache2k API documentation. Copyright © 2000–2014 headissue GmbH, Munich.