|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the type of the keys used to access data within the cacheV
- the type of the values held within the cachepublic interface Expiry<K,V>
A policy object that governs expiration for a Cache
See Expirations
for common instances
Method Summary | |
---|---|
Duration |
getExpiryForAccess(K key,
V value)
Get the expiration period (relative to the current time) when an existing entry is accessed from a Cache |
Duration |
getExpiryForCreation(K key,
V value)
Get the expiration period (relative to the current time) when a entry is initially added to a Cache |
Duration |
getExpiryForUpdate(K key,
V oldValue,
V newValue)
Get the expiration period (relative to the current time) when an existing entry is updated in a Cache
NOTE: Some cache configurations (eg. |
Method Detail |
---|
Duration getExpiryForCreation(K key, V value)
Cache
key
- the key of the newly added entryvalue
- the value of the newly added entry
Duration
Duration getExpiryForAccess(K key, V value)
Cache
key
- the key of the accessed entryvalue
- the value of the accessed entry
null
return value indicates "no change" to the expiration timeDuration getExpiryForUpdate(K key, V oldValue, V newValue)
Cache
NOTE: Some cache configurations (eg. caches with eventual consistency) may use local (ie. non-consistent) state
to decide whether to call getExpiryForUpdate() vs. getExpiryForCreation(). For these cache configurations it is advised
to return the same value from both of these methods
key
- the key of the updated entryoldValue
- the previous value of the entrynewValue
- the new value of the entry
null
return value indicates "no change" to the expiration time
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |