public interface TimeToLiveConfig
| Modifier and Type | Method and Description |
|---|---|
long |
getTimeToLiveMillis(Object v,
String cacheName)
Get time-to-live in milliseconds
|
boolean |
isStale(DeserializedItem item,
String cacheName)
Accessed by CacheImpl to check if item is stale
|
void |
setDefaultTimeToLive(long timeToLive,
TimeUnit timeUnit)
Define default time to live in milliseconds
|
TimeToLiveConfig |
setTimeToLive(Class<?> cls,
long timeToLive,
TimeUnit timeUnit)
Set item time to live by item class
|
TimeToLiveConfig |
setTimeToLive(String cacheName,
long timeToLive,
TimeUnit timeUnit)
Set item time to live by cache name
|
boolean isStale(DeserializedItem item, String cacheName)
item - deserialized itemcacheName - cache namelong getTimeToLiveMillis(Object v, String cacheName)
v - Actual cached valuecacheName - cache nameTimeToLiveConfig setTimeToLive(Class<?> cls, long timeToLive, TimeUnit timeUnit)
cls - class typetimeToLive - time to livetimeUnit - time-to-live unitTimeToLiveConfig setTimeToLive(String cacheName, long timeToLive, TimeUnit timeUnit)
cacheName - cache nametimeToLive - time to livetimeUnit - time-to-live unitvoid setDefaultTimeToLive(long timeToLive,
TimeUnit timeUnit)
timeToLive - default time-to-live in millisecondstimeUnit - time-to-live time unitCopyright © 2018. All rights reserved.