public class ReadCommittedEntry extends Object implements MVCCEntry
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ReadCommittedEntry.Flags |
| Modifier and Type | Field and Description |
|---|---|
protected byte |
flags |
protected Object |
key |
protected Metadata |
metadata |
protected Object |
oldValue |
protected Object |
value |
| Constructor and Description |
|---|
ReadCommittedEntry(Object key,
Object value,
Metadata metadata) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(DataContainer container,
Metadata providedMetadata)
Commits changes
|
void |
copyForUpdate(DataContainer container)
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(boolean enable,
ReadCommittedEntry.Flags flag) |
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 |
setSkipRemoteGet(boolean skipRemoteGet)
|
void |
setValid(boolean valid) |
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value
|
boolean |
skipRemoteGet() |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcomparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCodeprotected Object key
protected Object value
protected Object oldValue
protected byte flags
protected Metadata metadata
public byte getStateFlags()
getStateFlags in interface StateChangingEntrypublic void copyStateFlagsFrom(StateChangingEntry other)
copyStateFlagsFrom in interface StateChangingEntryprotected final boolean isFlagSet(ReadCommittedEntry.Flags flag)
flag - flag to testprotected 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()
CacheEntrypublic final Object getValue()
CacheEntrypublic final Object setValue(Object value)
CacheEntrypublic boolean isNull()
CacheEntryisNull in interface CacheEntrypublic void copyForUpdate(DataContainer container)
MVCCEntrycopyForUpdate in interface MVCCEntrycontainer - data containerpublic final void commit(DataContainer container, Metadata providedMetadata)
CacheEntrycommit in interface CacheEntrycontainer - data container to commit topublic final void rollback()
CacheEntryrollback in interface CacheEntrypublic final boolean isChanged()
isChanged in interface CacheEntrypublic final void setChanged(boolean changed)
setChanged in interface CacheEntrysetChanged in interface MVCCEntrypublic void setSkipRemoteGet(boolean skipRemoteGet)
CacheEntrysetSkipRemoteGet in interface CacheEntrypublic boolean skipRemoteGet()
skipRemoteGet in interface CacheEntrytrue if the value must not be fetch from a remote node.public boolean isValid()
isValid in interface CacheEntrypublic final void setValid(boolean valid)
setValid in interface CacheEntrypublic Metadata getMetadata()
MetadataAwaregetMetadata in interface MetadataAwarepublic void setMetadata(Metadata metadata)
MetadataAwaresetMetadata 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 CacheEntryprotected final void setFlag(boolean enable,
ReadCommittedEntry.Flags flag)
public boolean undelete(boolean doUndelete)
CacheEntryundelete in interface CacheEntryCopyright © 2014 JBoss, a division of Red Hat. All rights reserved.