|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.container.entries.DeltaAwareCacheEntry
public class DeltaAwareCacheEntry
A wrapper around a cached entry that encapsulates DeltaAware and Delta semantics when writes are initiated, committed or rolled back.
Nested Class Summary | |
---|---|
protected static class |
DeltaAwareCacheEntry.Flags
|
Field Summary | |
---|---|
protected List<Delta> |
deltas
|
protected byte |
flags
|
protected Object |
key
|
protected DeltaAware |
oldValue
|
protected AtomicHashMap<?,?> |
uncommittedChanges
|
protected DeltaAware |
value
|
protected CacheEntry |
wrappedEntry
|
Constructor Summary | |
---|---|
DeltaAwareCacheEntry(Object key,
DeltaAware value,
CacheEntry wrappedEntry)
|
Method Summary | |
---|---|
void |
appendDelta(Delta d)
|
void |
commit(DataContainer container,
EntryVersion version)
Commits changes |
void |
copyForUpdate(DataContainer container,
boolean writeSkewCheck)
|
void |
copyStateFlagsFrom(StateChangingEntry other)
|
Object |
getKey()
Retrieves the key to this entry |
long |
getLifespan()
|
long |
getMaxIdle()
|
byte |
getStateFlags()
|
AtomicHashMap<?,?> |
getUncommittedChages()
|
Object |
getValue()
Retrieves the value of this entry |
EntryVersion |
getVersion()
|
boolean |
isChanged()
|
boolean |
isCreated()
|
boolean |
isEvicted()
|
protected boolean |
isFlagSet(DeltaAwareCacheEntry.Flags flag)
Tests whether a flag is set. |
boolean |
isLockPlaceholder()
|
boolean |
isNull()
Tests whether the entry represents a null value, typically used for repeatable read. |
boolean |
isRemoved()
|
boolean |
isValid()
|
void |
rollback()
Rolls back changes |
protected void |
setChanged()
|
void |
setCreated(boolean created)
|
void |
setEvicted(boolean evicted)
|
protected void |
setFlag(DeltaAwareCacheEntry.Flags flag)
Utility method that sets the value of the given flag to true. |
void |
setLifespan(long lifespan)
Sets the lifespan of the entry. |
void |
setMaxIdle(long maxIdle)
Sets the maximum idle time of the entry. |
void |
setRemoved(boolean removed)
|
void |
setValid(boolean valid)
|
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value |
void |
setVersion(EntryVersion version)
Sets the version on this entry. |
String |
toString()
|
boolean |
undelete(boolean doUndelete)
If the entry is marked as removed and doUndelete==true then the "valid" flag is set to true and "removed" flag is set to false. |
protected void |
unsetFlag(DeltaAwareCacheEntry.Flags flag)
Utility method that sets the value of the flag to false. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map.Entry |
---|
equals, hashCode |
Field Detail |
---|
protected Object key
protected CacheEntry wrappedEntry
protected DeltaAware value
protected DeltaAware oldValue
protected final List<Delta> deltas
protected byte flags
protected AtomicHashMap<?,?> uncommittedChanges
Constructor Detail |
---|
public DeltaAwareCacheEntry(Object key, DeltaAware value, CacheEntry wrappedEntry)
Method Detail |
---|
public byte getStateFlags()
getStateFlags
in interface StateChangingEntry
public void copyStateFlagsFrom(StateChangingEntry other)
copyStateFlagsFrom
in interface StateChangingEntry
public void appendDelta(Delta d)
public AtomicHashMap<?,?> getUncommittedChages()
protected final boolean isFlagSet(DeltaAwareCacheEntry.Flags flag)
flag
- flag to test
protected final void setFlag(DeltaAwareCacheEntry.Flags flag)
flag
- flag to setprotected final void unsetFlag(DeltaAwareCacheEntry.Flags flag)
flag
- flag to unsetpublic final long getLifespan()
getLifespan
in interface CacheEntry
public final long getMaxIdle()
getMaxIdle
in interface CacheEntry
public final void setMaxIdle(long maxIdle)
CacheEntry
setMaxIdle
in interface CacheEntry
maxIdle
- maxIdle to setpublic final void setLifespan(long lifespan)
CacheEntry
setLifespan
in interface CacheEntry
lifespan
- lifespan to setpublic final Object getKey()
CacheEntry
getKey
in interface Map.Entry<Object,Object>
getKey
in interface CacheEntry
public final Object getValue()
CacheEntry
getValue
in interface Map.Entry<Object,Object>
getValue
in interface CacheEntry
public final Object setValue(Object value)
CacheEntry
setValue
in interface Map.Entry<Object,Object>
setValue
in interface CacheEntry
value
- value to set
public boolean isNull()
CacheEntry
isNull
in interface CacheEntry
public void copyForUpdate(DataContainer container, boolean writeSkewCheck)
public final void commit(DataContainer container, EntryVersion version)
CacheEntry
commit
in interface CacheEntry
container
- data container to commit topublic final void rollback()
CacheEntry
rollback
in interface CacheEntry
public final boolean isChanged()
isChanged
in interface CacheEntry
protected final void setChanged()
public boolean isValid()
isValid
in interface CacheEntry
public final void setValid(boolean valid)
setValid
in interface CacheEntry
public boolean isLockPlaceholder()
isLockPlaceholder
in interface CacheEntry
public final boolean isCreated()
isCreated
in interface CacheEntry
public final void setCreated(boolean created)
setCreated
in interface CacheEntry
public boolean isRemoved()
isRemoved
in interface CacheEntry
public boolean isEvicted()
isEvicted
in interface CacheEntry
public final void setRemoved(boolean removed)
setRemoved
in interface CacheEntry
public void setEvicted(boolean evicted)
setEvicted
in interface CacheEntry
public String toString()
toString
in class Object
public boolean undelete(boolean doUndelete)
CacheEntry
undelete
in interface CacheEntry
public EntryVersion getVersion()
getVersion
in interface Versioned
public void setVersion(EntryVersion version)
Versioned
setVersion
in interface Versioned
version
- version to set
|
--> | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |