|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the type of keysV
- the type of valuespublic interface ExpiryPolicy<K,V>
Defines functions to determine when cache entries will expire based on creation, access and modification operations.
Each of the functions return aConfiguration.Duration
that of which specifies the
amount of time that must pass before a cache entry is considered expired.
This Configuration.Duration
is often called a "time-to-live", commonly abbreviated
to simply "TTL".
Nested Class Summary | |
---|---|
static class |
ExpiryPolicy.Accessed<K,V>
A ExpiryPolicy that defines the expiry Configuration.Duration
of a Cache Entry based on the last time it was accessed. |
static class |
ExpiryPolicy.Default<K,V>
The default ExpiryPolicy specifies that Cache Entries
won't expire. |
static class |
ExpiryPolicy.Modified<K,V>
A ExpiryPolicy that defines the expiry Configuration.Duration
of a Cache Entry based on the last time it was modified. |
Method Summary | |
---|---|
Configuration.Duration |
getTTLForAccessedEntry(Cache.Entry<? extends K,? extends V> entry,
Configuration.Duration duration)
Gets the time-to-live before the accessed Cache.Entry is considered expired. |
Configuration.Duration |
getTTLForCreatedEntry(Cache.Entry<? extends K,? extends V> entry)
Gets the time-to-live before the newly Cache.Entry is considered expired. |
Configuration.Duration |
getTTLForModifiedEntry(Cache.Entry<? extends K,? extends V> entry,
Configuration.Duration duration)
Gets the time-to-live before the modified Cache.Entry is considered expired. |
Method Detail |
---|
Configuration.Duration getTTLForCreatedEntry(Cache.Entry<? extends K,? extends V> entry)
Configuration.Duration
before the
said entry expires. If a Configuration.Duration.ZERO
is returned the Cache.Entry is
considered to be already expired and will not be added to the Cache.
entry
- the cache entry that was created
Configuration.Duration getTTLForAccessedEntry(Cache.Entry<? extends K,? extends V> entry, Configuration.Duration duration)
Configuration.Duration
before the said entry expires in the future. If a
Configuration.Duration.ZERO
is returned the Cache.Entry will be considered
expired for future access.
entry
- the cache entry that was accessedduration
- the current Configuration.Duration
before the entry expires
Configuration.Duration getTTLForModifiedEntry(Cache.Entry<? extends K,? extends V> entry, Configuration.Duration duration)
Configuration.Duration
before the updated entry expires. If a
Configuration.Duration.ZERO
is returned the Cache.Entry is considered already
expired.
entry
- the cache entry that was modifiedduration
- the current Configuration.Duration
before the updated entry expires
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |