public class MetadataTransientMortalCacheEntry extends AbstractInternalCacheEntry implements MetadataAware
TransientMortalCacheEntry
that is Versioned| Modifier and Type | Class and Description |
|---|---|
static class |
MetadataTransientMortalCacheEntry.Externalizer |
key| Constructor and Description |
|---|
MetadataTransientMortalCacheEntry(Object key,
Object value,
Metadata metadata,
long now) |
MetadataTransientMortalCacheEntry(Object key,
Object value,
Metadata metadata,
long lastUsed,
long created) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canExpire() |
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
|
boolean |
isExpired() |
boolean |
isExpired(long now) |
void |
reincarnate()
"Reincarnates" an entry.
|
void |
reincarnate(long now)
"Reincarnates" an entry.
|
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. |
void |
touch()
Updates access timestamps on this instance
|
void |
touch(long currentTimeMillis)
Updates access timestamps on this instance to a specified time
|
clone, commit, getKey, isChanged, isCreated, isEvicted, isLoaded, isNull, isRemoved, isValid, rollback, setChanged, setCreated, setEvicted, setLoaded, setRemoved, setSkipLookup, setValid, skipLookup, toString, undeletepublic MetadataTransientMortalCacheEntry(Object key, Object value, Metadata metadata, long now)
public Object getValue()
CacheEntrypublic long getLifespan()
getLifespan in interface CacheEntrypublic final boolean canExpire()
canExpire in interface InternalCacheEntrypublic long getCreated()
getCreated in interface InternalCacheEntrypublic boolean isExpired(long now)
isExpired in interface InternalCacheEntrynow - the current time as defined by System.currentTimeMillis() or TimeService.wallClockTime()public boolean isExpired()
isExpired in interface InternalCacheEntrypublic final long getExpiryTime()
InternalCacheEntrygetExpiryTime in interface 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.
toInternalCacheValue in interface InternalCacheEntrypublic long getLastUsed()
getLastUsed in interface InternalCacheEntrypublic final void touch()
InternalCacheEntrytouch in interface InternalCacheEntrypublic final void touch(long currentTimeMillis)
InternalCacheEntrytouch in interface InternalCacheEntrycurrentTimeMillis - the current time as defined by System.currentTimeMillis() or TimeService.wallClockTime()public final void reincarnate()
InternalCacheEntryreincarnate in interface InternalCacheEntrypublic void reincarnate(long now)
InternalCacheEntryreincarnate in interface InternalCacheEntrynow - the current time as defined by System.currentTimeMillis() or TimeService.wallClockTime()public long getMaxIdle()
getMaxIdle in interface CacheEntrypublic Object setValue(Object value)
CacheEntrypublic 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 entryCopyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.