org.infinispan.container.entries
Class AbstractInternalCacheEntry

java.lang.Object
  extended by org.infinispan.container.entries.AbstractInternalCacheEntry
All Implemented Interfaces:
Cloneable, Map.Entry<Object,Object>, CacheEntry, InternalCacheEntry, Versioned
Direct Known Subclasses:
ImmortalCacheEntry, MortalCacheEntry, TransientCacheEntry, TransientMortalCacheEntry

public abstract class AbstractInternalCacheEntry
extends Object
implements InternalCacheEntry

An abstract internal cache entry that is typically stored in the data container

Since:
4.0
Author:
Manik Surtani

Field Summary
protected  Object key
           
 
Constructor Summary
protected AbstractInternalCacheEntry()
           
protected AbstractInternalCacheEntry(Object key)
           
 
Method Summary
 AbstractInternalCacheEntry clone()
           
 void commit(DataContainer container, EntryVersion newVersion)
          Commits changes
 Object getKey()
          Retrieves the key to this entry
 EntryVersion getVersion()
           
 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)
           
 void setVersion(EntryVersion version)
          Sets the version on this entry.
 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.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.container.entries.InternalCacheEntry
canExpire, getCreated, getExpiryTime, getLastUsed, isExpired, isExpired, reincarnate, toInternalCacheValue, touch, touch
 
Methods inherited from interface org.infinispan.container.entries.CacheEntry
getLifespan, getMaxIdle, getValue, setValue
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

Field Detail

key

protected Object key
Constructor Detail

AbstractInternalCacheEntry

protected AbstractInternalCacheEntry()

AbstractInternalCacheEntry

protected AbstractInternalCacheEntry(Object key)
Method Detail

commit

public final void commit(DataContainer container,
                         EntryVersion newVersion)
Description copied from interface: CacheEntry
Commits changes

Specified by:
commit in interface CacheEntry
Parameters:
container - data container to commit to

rollback

public final void rollback()
Description copied from interface: CacheEntry
Rolls back changes

Specified by:
rollback in interface CacheEntry

setCreated

public final void setCreated(boolean created)
Specified by:
setCreated in interface CacheEntry

setRemoved

public final void setRemoved(boolean removed)
Specified by:
setRemoved in interface CacheEntry

setEvicted

public final void setEvicted(boolean evicted)
Specified by:
setEvicted in interface CacheEntry

setValid

public final void setValid(boolean valid)
Specified by:
setValid in interface CacheEntry

isNull

public final boolean isNull()
Description copied from interface: CacheEntry
Tests whether the entry represents a null value, typically used for repeatable read.

Specified by:
isNull in interface CacheEntry
Returns:
true if this represents a null, false otherwise.

isChanged

public final boolean isChanged()
Specified by:
isChanged in interface CacheEntry
Returns:
true if this entry has changed since being read from the container, false otherwise.

isCreated

public final boolean isCreated()
Specified by:
isCreated in interface CacheEntry
Returns:
true if this entry has been newly created, false otherwise.

isRemoved

public final boolean isRemoved()
Specified by:
isRemoved in interface CacheEntry
Returns:
true if this entry has been removed since being read from the container, false otherwise.

isEvicted

public final boolean isEvicted()
Specified by:
isEvicted in interface CacheEntry
Returns:
true if this entry has been evicted since being read from the container, false otherwise.

isValid

public final boolean isValid()
Specified by:
isValid in interface CacheEntry
Returns:
true if this entry is still valid, false otherwise.

undelete

public boolean undelete(boolean doUndelete)
Description copied from interface: CacheEntry
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.

Specified by:
undelete in interface CacheEntry

isLockPlaceholder

public final boolean isLockPlaceholder()
Specified by:
isLockPlaceholder in interface CacheEntry
Returns:
true if this entry is a placeholder for the sake of acquiring a lock; and false if it is a real entry.

setMaxIdle

public void setMaxIdle(long maxIdle)
Description copied from interface: InternalCacheEntry
Sets the maximum idle time of the entry.

Specified by:
setMaxIdle in interface CacheEntry
Specified by:
setMaxIdle in interface InternalCacheEntry
Parameters:
maxIdle - maxIdle to set

setLifespan

public void setLifespan(long lifespan)
Description copied from interface: InternalCacheEntry
Sets the lifespan of the entry.

Specified by:
setLifespan in interface CacheEntry
Specified by:
setLifespan in interface InternalCacheEntry
Parameters:
lifespan - lifespan to set

getVersion

public EntryVersion getVersion()
Specified by:
getVersion in interface Versioned
Returns:
the version of the entry. May be null if versioning is not supported, and must never be null if versioning is supported.

setVersion

public void setVersion(EntryVersion version)
Description copied from interface: Versioned
Sets the version on this entry.

Specified by:
setVersion in interface Versioned
Parameters:
version - version to set

getKey

public final Object getKey()
Description copied from interface: CacheEntry
Retrieves the key to this entry

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

toString

public String toString()
Overrides:
toString in class Object

clone

public AbstractInternalCacheEntry clone()
Specified by:
clone in interface InternalCacheEntry
Overrides:
clone in class Object

-->

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