public class MortalCacheEntry extends AbstractInternalCacheEntry
Modifier and Type | Class and Description |
---|---|
static class |
MortalCacheEntry.Externalizer |
Modifier and Type | Field and Description |
---|---|
protected MortalCacheValue |
cacheValue |
key
Modifier | Constructor and Description |
---|---|
protected |
MortalCacheEntry(Object key,
MortalCacheValue cacheValue) |
|
MortalCacheEntry(Object key,
Object value,
long lifespan) |
|
MortalCacheEntry(Object key,
Object value,
long lifespan,
long created) |
Modifier and Type | Method and Description |
---|---|
boolean |
canExpire() |
MortalCacheEntry |
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() |
Object |
getValue()
Retrieves the value of this entry
|
int |
hashCode() |
boolean |
isExpired() |
boolean |
isExpired(long now) |
void |
reincarnate()
"Reincarnates" an entry.
|
void |
setLifespan(long lifespan)
Sets the lifespan of the 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, getVersion, isChanged, isCreated, isEvicted, isLockPlaceholder, isNull, isRemoved, isValid, rollback, setCreated, setEvicted, setMaxIdle, setRemoved, setValid, setVersion, undelete
protected MortalCacheValue cacheValue
protected MortalCacheEntry(Object key, MortalCacheValue cacheValue)
public Object getValue()
CacheEntry
public Object setValue(Object value)
CacheEntry
value
- value to setpublic final boolean isExpired(long now)
public final boolean isExpired()
public final boolean canExpire()
public void setLifespan(long lifespan)
InternalCacheEntry
setLifespan
in interface CacheEntry
setLifespan
in interface InternalCacheEntry
setLifespan
in class AbstractInternalCacheEntry
lifespan
- lifespan to setpublic final long getCreated()
public final long getLastUsed()
public final long getLifespan()
public final long getMaxIdle()
public final long getExpiryTime()
InternalCacheEntry
public final void touch()
InternalCacheEntry
public final void touch(long currentTimeMillis)
InternalCacheEntry
public final void reincarnate()
InternalCacheEntry
public InternalCacheValue toInternalCacheValue()
InternalCacheEntry
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.
public boolean equals(Object o)
public int hashCode()
public MortalCacheEntry clone()
clone
in interface InternalCacheEntry
clone
in class AbstractInternalCacheEntry
public String toString()
toString
in class AbstractInternalCacheEntry
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.