|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.container.entries.ReadCommittedEntry
public class ReadCommittedEntry
A wrapper around a cached entry that encapsulates read committed semantics when writes are initiated, committed or rolled back.
| Nested Class Summary | |
|---|---|
protected static class |
ReadCommittedEntry.Flags
|
| Field Summary | |
|---|---|
protected byte |
flags
|
protected Object |
key
|
protected Metadata |
metadata
|
protected Object |
oldValue
|
protected Object |
value
|
| Constructor Summary | |
|---|---|
ReadCommittedEntry(Object key,
Object value,
Metadata metadata)
|
|
| Method Summary | |
|---|---|
void |
commit(DataContainer container,
Metadata providedMetadata)
Commits changes |
void |
copyForUpdate(DataContainer container,
boolean writeSkewCheck)
Makes internal copies of the entry for updates |
void |
copyStateFlagsFrom(StateChangingEntry other)
|
Object |
getKey()
Retrieves the key to this entry |
long |
getLifespan()
|
long |
getMaxIdle()
|
Metadata |
getMetadata()
Get metadata of this cache entry. |
byte |
getStateFlags()
|
Object |
getValue()
Retrieves the value of this entry |
boolean |
isChanged()
|
boolean |
isCreated()
|
boolean |
isEvicted()
|
protected boolean |
isFlagSet(ReadCommittedEntry.Flags flag)
Tests whether a flag is set. |
boolean |
isLoaded()
|
boolean |
isNull()
Tests whether the entry represents a null value, typically used for repeatable read. |
boolean |
isRemoved()
|
boolean |
isValid()
|
void |
rollback()
Rolls back changes |
void |
setChanged(boolean changed)
|
void |
setCreated(boolean created)
|
void |
setEvicted(boolean evicted)
|
protected void |
setFlag(ReadCommittedEntry.Flags flag)
Utility method that sets the value of the given flag to true. |
void |
setLoaded(boolean loaded)
|
void |
setMetadata(Metadata metadata)
Set the metadata in the cache entry. |
void |
setRemoved(boolean removed)
|
void |
setValid(boolean valid)
|
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value |
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(ReadCommittedEntry.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 Object value
protected Object oldValue
protected byte flags
protected Metadata metadata
| Constructor Detail |
|---|
public ReadCommittedEntry(Object key,
Object value,
Metadata metadata)
| Method Detail |
|---|
public byte getStateFlags()
getStateFlags in interface StateChangingEntrypublic void copyStateFlagsFrom(StateChangingEntry other)
copyStateFlagsFrom in interface StateChangingEntryprotected final boolean isFlagSet(ReadCommittedEntry.Flags flag)
flag - flag to test
protected final void setFlag(ReadCommittedEntry.Flags flag)
flag - flag to setprotected final void unsetFlag(ReadCommittedEntry.Flags flag)
flag - flag to unsetpublic final long getLifespan()
getLifespan in interface CacheEntrypublic final long getMaxIdle()
getMaxIdle in interface CacheEntrypublic final Object getKey()
CacheEntry
getKey in interface Map.Entry<Object,Object>getKey in interface CacheEntrypublic final Object getValue()
CacheEntry
getValue in interface Map.Entry<Object,Object>getValue in interface CacheEntrypublic final Object setValue(Object value)
CacheEntry
setValue in interface Map.Entry<Object,Object>setValue in interface CacheEntryvalue - value to set
public boolean isNull()
CacheEntry
isNull in interface CacheEntry
public void copyForUpdate(DataContainer container,
boolean writeSkewCheck)
MVCCEntry
copyForUpdate in interface MVCCEntrycontainer - data containerwriteSkewCheck - if true, write skews are tested for and exceptions are thrown if detected. Only applicable
to IsolationLevel.REPEATABLE_READ.
public final void commit(DataContainer container,
Metadata providedMetadata)
CacheEntry
commit in interface CacheEntrycontainer - data container to commit topublic final void rollback()
CacheEntry
rollback in interface CacheEntrypublic final boolean isChanged()
isChanged in interface CacheEntrypublic final void setChanged(boolean changed)
setChanged in interface CacheEntrysetChanged in interface MVCCEntrypublic boolean isValid()
isValid in interface CacheEntrypublic final void setValid(boolean valid)
setValid in interface CacheEntrypublic Metadata getMetadata()
MetadataAware
getMetadata in interface MetadataAwarepublic void setMetadata(Metadata metadata)
MetadataAware
setMetadata in interface MetadataAwaremetadata - to apply to the cache entrypublic final boolean isCreated()
isCreated in interface CacheEntrypublic final void setCreated(boolean created)
setCreated in interface CacheEntrypublic boolean isRemoved()
isRemoved in interface CacheEntrypublic boolean isEvicted()
isEvicted in interface CacheEntrypublic final void setRemoved(boolean removed)
setRemoved in interface CacheEntrypublic void setEvicted(boolean evicted)
setEvicted in interface CacheEntrypublic boolean isLoaded()
isLoaded in interface CacheEntrypublic void setLoaded(boolean loaded)
setLoaded in interface CacheEntrypublic String toString()
toString in class Objectpublic boolean undelete(boolean doUndelete)
CacheEntry
undelete in interface CacheEntry
|
--> | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||