public interface InternalCacheEntry<K,V> extends CacheEntry<K,V>, Cloneable
Modifier and Type | Method and Description |
---|---|
boolean |
canExpire() |
default boolean |
canExpireMaxIdle() |
InternalCacheEntry<K,V> |
clone() |
long |
getExpiryTime()
Only used with entries that have a lifespan, this determines when an entry is due to expire.
|
boolean |
isExpired(long now) |
boolean |
isL1Entry() |
void |
reincarnate(long now)
"Reincarnates" an entry.
|
InternalCacheValue<V> |
toInternalCacheValue()
Creates a representation of this entry as an
InternalCacheValue . |
void |
touch(long currentTimeMillis)
Updates access timestamps on this instance to a specified time
|
commit, getCreated, getInternalMetadata, getKey, getLastUsed, getLifespan, getMaxIdle, getValue, isChanged, isCreated, isEvicted, isNull, isRemoved, setChanged, setCreated, setCreated, setEvicted, setInternalMetadata, setLastUsed, setRemoved, setSkipLookup, setValue, skipLookup
comparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCode
getMetadata, setMetadata
boolean isExpired(long now)
now
- the current time as defined by System.currentTimeMillis()
or TimeService.wallClockTime()
boolean canExpire()
default boolean canExpireMaxIdle()
long getExpiryTime()
void touch(long currentTimeMillis)
currentTimeMillis
- the current time as defined by System.currentTimeMillis()
or TimeService.wallClockTime()
void reincarnate(long now)
now
- the current time as defined by System.currentTimeMillis()
or TimeService.wallClockTime()
boolean isL1Entry()
true
if the entry is a L1 entry.InternalCacheValue<V> toInternalCacheValue()
InternalCacheValue
. The main
purpose of this is to provide a representation that does not have a reference to the key. This is useful in
situations where the key is already known or stored elsewhere, making serialization and deserialization more
efficient.
Note that this should not be used to optimize memory overhead, since the saving of an additional reference to a
key (a single object reference) does not warrant the cost of constructing an InternalCacheValue. This only
makes sense when marshalling is involved, since the cost of marshalling the key again can be sidestepped using an
InternalCacheValue if the key is already known/marshalled.
InternalCacheEntry<K,V> clone()
clone
in interface CacheEntry<K,V>
Copyright © 2021 JBoss by Red Hat. All rights reserved.