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 long |
created |
protected byte |
flags |
protected Object |
key |
protected long |
lastUsed |
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 |
---|---|
ReadCommittedEntry |
clone() |
void |
commit(DataContainer container,
Metadata providedMetadata)
Commits changes
|
void |
copyForUpdate()
Makes internal copies of the entry for updates
|
void |
copyStateFlagsFrom(StateChangingEntry other) |
long |
getCreated() |
Object |
getKey()
Retrieves the key to this entry
|
long |
getLastUsed() |
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() |
boolean |
isExpired()
Returns whether this entry was marked as being expired or not
|
boolean |
isLoaded()
Deprecated.
|
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 |
setCreated(long created) |
void |
setEvicted(boolean evicted) |
void |
setExpired(boolean expired)
Marks this entry as being expired.
|
protected void |
setFlag(ReadCommittedEntry.Flags flag)
Utility method that sets the value of the given flag to true.
|
void |
setLastUsed(long lastUsed) |
void |
setLoaded(boolean loaded)
Deprecated.
|
void |
setMetadata(Metadata metadata)
Set the metadata in the cache entry.
|
void |
setRemoved(boolean removed) |
void |
setSkipLookup(boolean skipLookup)
|
void |
setValid(boolean valid) |
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value
|
boolean |
skipLookup() |
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.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
copyForUpdate
comparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCode
protected Object key
protected Object value
protected Object oldValue
protected long created
protected long lastUsed
protected byte flags
protected Metadata metadata
public byte getStateFlags()
getStateFlags
in interface StateChangingEntry
public void copyStateFlagsFrom(StateChangingEntry other)
copyStateFlagsFrom
in interface StateChangingEntry
protected final void setFlag(ReadCommittedEntry.Flags flag)
flag
- flag to setpublic final long getLifespan()
getLifespan
in interface CacheEntry
public final long getMaxIdle()
getMaxIdle
in interface CacheEntry
public final Object getKey()
CacheEntry
getKey
in interface Map.Entry
getKey
in interface CacheEntry
public final Object getValue()
CacheEntry
getValue
in interface Map.Entry
getValue
in interface CacheEntry
public final Object setValue(Object value)
CacheEntry
setValue
in interface Map.Entry
setValue
in interface CacheEntry
value
- value to setpublic boolean isNull()
CacheEntry
isNull
in interface CacheEntry
public void copyForUpdate()
MVCCEntry
copyForUpdate
in interface MVCCEntry
public final void commit(DataContainer container, Metadata providedMetadata)
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
public final void setChanged(boolean changed)
setChanged
in interface CacheEntry
setChanged
in interface MVCCEntry
public void setSkipLookup(boolean skipLookup)
CacheEntry
setSkipLookup
in interface CacheEntry
public boolean skipLookup()
skipLookup
in interface CacheEntry
true
if the value must not be fetch from an external sourcepublic long getCreated()
getCreated
in interface CacheEntry
public long getLastUsed()
getLastUsed
in interface CacheEntry
public boolean isValid()
isValid
in interface CacheEntry
public final void setValid(boolean valid)
setValid
in interface CacheEntry
public Metadata getMetadata()
MetadataAware
getMetadata
in interface MetadataAware
public void setMetadata(Metadata metadata)
MetadataAware
setMetadata
in interface MetadataAware
metadata
- to apply to the cache entrypublic 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 boolean isExpired()
MVCCEntry
public final void setRemoved(boolean removed)
setRemoved
in interface CacheEntry
public void setEvicted(boolean evicted)
setEvicted
in interface CacheEntry
public void setExpired(boolean expired)
MVCCEntry
setExpired
in interface MVCCEntry
expired
- whether or not this entry should be expired@Deprecated public boolean isLoaded()
isLoaded
in interface CacheEntry
@Deprecated public void setLoaded(boolean loaded)
setLoaded
in interface CacheEntry
public ReadCommittedEntry clone()
clone
in interface CacheEntry
clone
in class Object
public void setCreated(long created)
setCreated
in interface CacheEntry
public void setLastUsed(long lastUsed)
setLastUsed
in interface CacheEntry
public boolean undelete(boolean doUndelete)
CacheEntry
undelete
in interface CacheEntry
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.