|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TimestampedValue<V>
Inside a DistributedCache, the map values are wrapped in a TimestampedValue that combines the actual value with information on created and last accessed times.
| Field Summary | |
|---|---|
static int |
NEVER_EXPIRE
Indicates the value will never expire (Integer.MAX_VALUE). |
| Method Summary | |
|---|---|
int |
expiresAt(CacheConfig config)
Determine when this value will expire based on the current configuration. |
CapacityEvictionPolicyData |
getCapacityEvictionPolicyData()
Retrieves this value's capacity eviction policy data. |
int |
getCreateTime()
Retrieves the time when this value was created. |
int |
getLastAccessedTime()
Retrieves the time when this value was last accessed. |
V |
getValue()
Get the actual value in the cache. |
boolean |
isExpired(int time,
CacheConfig config)
Determine whether this value will be expired at time based on the config. |
void |
markUsed(int usedAt,
String lockId,
CacheConfig config)
Mark this value as being used at the specified time. |
void |
setCapacityEvictionPolicyData(CapacityEvictionPolicyData capacityEvictionPolicyData)
Sets this value's capacity eviction policy data. |
| Field Detail |
|---|
static final int NEVER_EXPIRE
| Method Detail |
|---|
int expiresAt(CacheConfig config)
config - The configuration
NEVER_EXPIRE if
it will never expire.
boolean isExpired(int time,
CacheConfig config)
time - The time in seconds since the epoch for which to check. Should be > 0.config - The cache configuration
V getValue()
void markUsed(int usedAt,
String lockId,
CacheConfig config)
usedAt - Current time in seconds since the epochlockId - The lock string guarding this value, such as would be obtained by calling the underlying
ConcurrentDistributedMap.getLockIdForKey() methodconfig - The cache configurationint getCreateTime()
int getLastAccessedTime()
void setCapacityEvictionPolicyData(CapacityEvictionPolicyData capacityEvictionPolicyData)
capacityEvictionPolicyData - the new dataCapacityEvictionPolicyData getCapacityEvictionPolicyData()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||