public class TransientMortalCacheEntry extends AbstractInternalCacheEntry
| Modifier and Type | Class and Description |
|---|---|
static class |
TransientMortalCacheEntry.Externalizer |
| Modifier and Type | Field and Description |
|---|---|
protected long |
created |
protected long |
lastUsed |
protected long |
lifespan |
protected long |
maxIdle |
protected Object |
value |
key| Constructor and Description |
|---|
TransientMortalCacheEntry(Object key,
Object value,
long maxIdle,
long lifespan,
long currentTimeMillis) |
TransientMortalCacheEntry(Object key,
Object value,
long maxIdle,
long lifespan,
long lastUsed,
long created) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canExpire() |
TransientMortalCacheEntry |
clone() |
boolean |
equals(Object o) |
long |
getCreated() |
long |
getExpiryTime()
Only used with entries that have a lifespan, this determines when an entry is due to expire.
|
long |
getLastUsed() |
long |
getLifespan() |
long |
getMaxIdle() |
Metadata |
getMetadata()
Get metadata of this cache entry.
|
Object |
getValue()
Retrieves the value of this entry
|
int |
hashCode() |
boolean |
isExpired() |
boolean |
isExpired(long now) |
void |
reincarnate()
"Reincarnates" an entry.
|
void |
reincarnate(long now)
"Reincarnates" an entry.
|
void |
setLifespan(long lifespan) |
void |
setMaxIdle(long maxIdle) |
void |
setMetadata(Metadata metadata)
Set the metadata in the cache entry.
|
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value
|
InternalCacheValue |
toInternalCacheValue()
Creates a representation of this entry as an
InternalCacheValue. |
String |
toString() |
void |
touch()
Updates access timestamps on this instance
|
void |
touch(long currentTimeMillis)
Updates access timestamps on this instance to a specified time
|
commit, getKey, isChanged, isCreated, isEvicted, isL1Entry, isLoaded, isNull, isRemoved, isValid, rollback, setChanged, setCreated, setEvicted, setLoaded, setRemoved, setSkipLookup, setValid, skipLookup, undeletefinalize, getClass, notify, notifyAll, wait, wait, waitcomparingByKey, comparingByKey, comparingByValue, comparingByValueprotected Object value
protected long maxIdle
protected long lastUsed
protected long lifespan
protected long created
public TransientMortalCacheEntry(Object key, Object value, long maxIdle, long lifespan, long currentTimeMillis)
public void setLifespan(long lifespan)
public void setMaxIdle(long maxIdle)
public Object getValue()
CacheEntrypublic long getLifespan()
public final boolean canExpire()
public long getCreated()
public boolean isExpired(long now)
now - the current time as defined by System.currentTimeMillis() or TimeService.wallClockTime()public boolean isExpired()
public final long getExpiryTime()
InternalCacheEntrypublic InternalCacheValue toInternalCacheValue()
InternalCacheEntryInternalCacheValue. 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.
public long getLastUsed()
public final void touch()
InternalCacheEntrypublic final void touch(long currentTimeMillis)
InternalCacheEntrycurrentTimeMillis - the current time as defined by System.currentTimeMillis() or TimeService.wallClockTime()public final void reincarnate()
InternalCacheEntrypublic void reincarnate(long now)
InternalCacheEntrynow - the current time as defined by System.currentTimeMillis() or TimeService.wallClockTime()public long getMaxIdle()
public Object setValue(Object value)
CacheEntryvalue - value to setpublic Metadata getMetadata()
MetadataAwaregetMetadata in interface MetadataAwaregetMetadata in class AbstractInternalCacheEntrypublic void setMetadata(Metadata metadata)
MetadataAwaresetMetadata in interface MetadataAwaresetMetadata in class AbstractInternalCacheEntrymetadata - to apply to the cache entrypublic boolean equals(Object o)
public int hashCode()
public TransientMortalCacheEntry clone()
clone in interface CacheEntryclone in interface InternalCacheEntryclone in class AbstractInternalCacheEntrypublic String toString()
toString in class AbstractInternalCacheEntryCopyright © 2025 JBoss, a division of Red Hat. All rights reserved.