org.infinispan.container.entries
Interface CacheEntry

All Superinterfaces:
Map.Entry<Object,Object>
All Known Subinterfaces:
InternalCacheEntry, MVCCEntry
All Known Implementing Classes:
AbstractInternalCacheEntry, ImmortalCacheEntry, MortalCacheEntry, NullMarkerEntry, NullMarkerEntryForRemoval, ReadCommittedEntry, RepeatableReadEntry, TransientCacheEntry, TransientMortalCacheEntry

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

An entry that is stored in the data container

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

Method Summary
 void commit(DataContainer container)
          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 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 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, returing the previous value
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

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.

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, returing 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)
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)

setValid

void setValid(boolean valid)

Google Analytics

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