public final class AutoEntryRefreshController<T> extends Object implements RefreshController<T>
ValueWithNextRefreshTime
then the next refresh time
is fetched from the object. If not, the default linger time is used by the cache.Modifier and Type | Field and Description |
---|---|
static AutoEntryRefreshController |
INSTANCE
Deprecated.
|
Constructor and Description |
---|
AutoEntryRefreshController()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
long |
calculateNextRefreshTime(T _oldObject,
T _newObject,
long _timeOfLastRefresh,
long now)
Deprecated.
Returns the time of next refresh (expiry time) in milliseconds since epoch.
|
public static final AutoEntryRefreshController INSTANCE
public AutoEntryRefreshController()
public long calculateNextRefreshTime(T _oldObject, T _newObject, long _timeOfLastRefresh, long now)
RefreshController
Long.MAX_VALUE
is returned it means
there is no specific expiry time known or needed. In case a reasonable
default can be assumed for the expiry, the cache will use the
configured expiry time.
The cache may call the method a second (or more) times, if the expiry time needs a recalculation. The reason for this is to react on possible configuration changes properly. This may happen when an entry is read back from storage.
calculateNextRefreshTime
in interface RefreshController<T>
_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._newObject
- the value which will be put in the cache._timeOfLastRefresh
- time of the last cache refresh, by put or from the cache source.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–2015 headissue GmbH, Munich.