Package org.infinispan.container.entries
Class AbstractInternalCacheEntry
- java.lang.Object
-
- org.infinispan.container.entries.AbstractInternalCacheEntry
-
- All Implemented Interfaces:
java.lang.Cloneable,java.util.Map.Entry,CacheEntry,InternalCacheEntry,MetadataAware
- Direct Known Subclasses:
ImmortalCacheEntry,MetadataMortalCacheEntry,MetadataTransientCacheEntry,MetadataTransientMortalCacheEntry,MortalCacheEntry,TransientCacheEntry,TransientMortalCacheEntry
public abstract class AbstractInternalCacheEntry extends java.lang.Object implements InternalCacheEntry
An abstract internal cache entry that is typically stored in the data container- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Objectkey
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractInternalCacheEntry()protectedAbstractInternalCacheEntry(java.lang.Object key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractInternalCacheEntryclone()voidcommit(DataContainer container)Commits changesbooleanequals(java.lang.Object o)java.lang.ObjectgetKey()Retrieves the key to this entryMetadatagetMetadata()Get metadata of this cache entry.inthashCode()booleanisChanged()booleanisCreated()booleanisEvicted()booleanisL1Entry()booleanisNull()Tests whether the entry represents a null value, typically used for repeatable read.booleanisRemoved()voidsetChanged(boolean changed)voidsetCreated(boolean created)voidsetEvicted(boolean evicted)voidsetMetadata(Metadata metadata)Set the metadata in the cache entry.voidsetRemoved(boolean removed)voidsetSkipLookup(boolean skipLookup)booleanskipLookup()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.CacheEntry
commit, getCreated, getLastUsed, getLifespan, getMaxIdle, getValue, isLoaded, isValid, rollback, setCreated, setLastUsed, setLoaded, setValid, setValue, undelete
-
Methods inherited from interface org.infinispan.container.entries.InternalCacheEntry
canExpire, getExpiryTime, isExpired, isExpired, reincarnate, reincarnate, toInternalCacheValue, touch, touch
-
-
-
-
Method Detail
-
commit
public final void commit(DataContainer container)
Description copied from interface:CacheEntryCommits changes- Specified by:
commitin interfaceCacheEntry- Parameters:
container- data container to commit to
-
setChanged
public void setChanged(boolean changed)
- Specified by:
setChangedin interfaceCacheEntry
-
setCreated
public final void setCreated(boolean created)
- Specified by:
setCreatedin interfaceCacheEntry
-
setRemoved
public final void setRemoved(boolean removed)
- Specified by:
setRemovedin interfaceCacheEntry
-
setEvicted
public final void setEvicted(boolean evicted)
- Specified by:
setEvictedin interfaceCacheEntry
-
setSkipLookup
public void setSkipLookup(boolean skipLookup)
Description copied from interface:CacheEntry- Specified by:
setSkipLookupin interfaceCacheEntry
-
isNull
public final boolean isNull()
Description copied from interface:CacheEntryTests whether the entry represents a null value, typically used for repeatable read.- Specified by:
isNullin interfaceCacheEntry- Returns:
- true if this represents a null, false otherwise.
-
isChanged
public final boolean isChanged()
- Specified by:
isChangedin interfaceCacheEntry- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
isCreated
public final boolean isCreated()
- Specified by:
isCreatedin interfaceCacheEntry- Returns:
- true if this entry has been newly created, false otherwise.
-
isRemoved
public final boolean isRemoved()
- Specified by:
isRemovedin interfaceCacheEntry- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
isEvicted
public final boolean isEvicted()
- Specified by:
isEvictedin interfaceCacheEntry- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
skipLookup
public boolean skipLookup()
- Specified by:
skipLookupin interfaceCacheEntry- Returns:
trueif the value must not be fetch from an external source
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataAwareGet metadata of this cache entry.- Specified by:
getMetadatain interfaceMetadataAware- Returns:
- a Metadata instance
-
setMetadata
public void setMetadata(Metadata metadata)
Description copied from interface:MetadataAwareSet the metadata in the cache entry.- Specified by:
setMetadatain interfaceMetadataAware- Parameters:
metadata- to apply to the cache entry
-
getKey
public final java.lang.Object getKey()
Description copied from interface:CacheEntryRetrieves the key to this entry- Specified by:
getKeyin interfaceCacheEntry- Specified by:
getKeyin interfacejava.util.Map.Entry- Returns:
- a key
-
isL1Entry
public boolean isL1Entry()
- Specified by:
isL1Entryin interfaceInternalCacheEntry- Returns:
trueif the entry is a L1 entry.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public AbstractInternalCacheEntry clone()
- Specified by:
clonein interfaceCacheEntry- Specified by:
clonein interfaceInternalCacheEntry- Overrides:
clonein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Map.Entry- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Specified by:
hashCodein interfacejava.util.Map.Entry- Overrides:
hashCodein classjava.lang.Object
-
-