org.infinispan.container.entries
Interface CacheEntry

All Superinterfaces:
Map.Entry<Object,Object>, Versioned
All Known Subinterfaces:
InternalCacheEntry, MVCCEntry
All Known Implementing Classes:
AbstractInternalCacheEntry, ClusteredRepeatableReadEntry, DeltaAwareCacheEntry, ImmortalCacheEntry, MortalCacheEntry, NullMarkerEntry, NullMarkerEntryForRemoval, ReadCommittedEntry, RepeatableReadEntry, TransientCacheEntry, TransientMortalCacheEntry, VersionedImmortalCacheEntry, VersionedMortalCacheEntry, VersionedTransientCacheEntry, VersionedTransientMortalCacheEntry

public interface CacheEntry
extends Map.Entry<Object,Object>, Versioned

An entry that is stored in the data container

Since:
4.0
Author:
Manik Surtani, Galder ZamarreƱo

Method Summary
 void commit(DataContainer container, EntryVersion newVersion)
          Commits changes
 Object getKey()
          Retrieves the key to this entry
 long getLifespan()
           
 long getMaxIdle()
           
 Object getValue()
          Retrieves the value of this entry
 boolean isChanged()
           
 boolean isCreated()
           
 boolean isEvicted()
           
 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
 void setCreated(boolean created)
           
 void setEvicted(boolean evicted)
           
 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
 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.
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 
Methods inherited from interface org.infinispan.container.entries.versioned.Versioned
getVersion, setVersion
 

Method Detail

isNull

boolean isNull()
Tests whether the entry represents a null value, typically used for repeatable read.

Returns:
true if this represents a null, false otherwise.

isChanged

boolean isChanged()
Returns:
true if this entry has changed since being read from the container, false otherwise.

isCreated

boolean isCreated()
Returns:
true if this entry has been newly created, false otherwise.

isRemoved

boolean isRemoved()
Returns:
true if this entry has been removed since being read from the container, false otherwise.

isEvicted

boolean isEvicted()
Returns:
true if this entry has been evicted since being read from the container, false otherwise.

isValid

boolean isValid()
Returns:
true if this entry is still valid, false otherwise.

getKey

Object getKey()
Retrieves the key to this entry

Specified by:
getKey in interface Map.Entry<Object,Object>
Returns:
a key

getValue

Object getValue()
Retrieves the value of this entry

Specified by:
getValue in interface Map.Entry<Object,Object>
Returns:
the value of the entry

getLifespan

long getLifespan()
Returns:
retrieves the lifespan of this entry. -1 means an unlimited lifespan.

getMaxIdle

long getMaxIdle()
Returns:
the maximum allowed time for which this entry can be idle, after which it is considered expired.

setMaxIdle

void setMaxIdle(long maxIdle)
Sets the maximum idle time of the entry.

Parameters:
maxIdle - maxIdle to set

setLifespan

void setLifespan(long lifespan)
Sets the lifespan of the entry.

Parameters:
lifespan - lifespan to set

setValue

Object setValue(Object value)
Sets the value of the entry, returning the previous value

Specified by:
setValue in interface Map.Entry<Object,Object>
Parameters:
value - value to set
Returns:
previous value

commit

void commit(DataContainer container,
            EntryVersion newVersion)
Commits changes

Parameters:
container - data container to commit to

rollback

void rollback()
Rolls back changes


setCreated

void setCreated(boolean created)

setRemoved

void setRemoved(boolean removed)

setEvicted

void setEvicted(boolean evicted)

setValid

void setValid(boolean valid)

isLockPlaceholder

boolean isLockPlaceholder()
Returns:
true if this entry is a placeholder for the sake of acquiring a lock; and false if it is a real entry.

undelete

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.


-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.