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
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

Method Summary
 AbstractInternalCacheEntry clone()
           
 void commit(DataContainer container)
          Commits changes
 Object getKey()
          Retrieves the key to 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)
           
 String toString()
           
 
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, toInternalCacheValue, touch
 
Methods inherited from interface org.infinispan.container.entries.CacheEntry
getLifespan, getMaxIdle, getValue, setValue
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

Method Detail

commit

public final void commit(DataContainer container)
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

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.

isValid

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

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

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

Google Analytics

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