K
- the type of keysV
- the type of valuespublic interface ExpiryPolicy<K,V>
Configuration.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".Modifier and Type | Interface and Description |
---|---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.entry
- the cache entry that was createdConfiguration.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.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.entry
- the cache entry that was accessedduration
- the current Configuration.Duration
before the entry expiresConfiguration.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.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.entry
- the cache entry that was modifiedduration
- the current Configuration.Duration
before the updated entry expiresCopyright © 2013. All Rights Reserved.