org.hibernate.cache
Class ReadWriteCache.Item

java.lang.Object
  extended byorg.hibernate.cache.ReadWriteCache.Item
All Implemented Interfaces:
ReadWriteCache.Lockable, Serializable
Enclosing class:
ReadWriteCache

public static final class ReadWriteCache.Item
extends Object
implements Serializable, ReadWriteCache.Lockable

An item of cached data, timestamped with the time it was cached,.

See Also:
ReadWriteCache, Serialized Form

Constructor Summary
ReadWriteCache.Item(Object value, Object version, long currentTimestamp)
           
 
Method Summary
 long getFreshTimestamp()
          The timestamp on the cached data
 Object getValue()
          The actual cached data
 boolean isGettable(long txTimestamp)
          Is this item visible to the timestamped transaction?
 boolean isLock()
          Not a lock!
 boolean isPuttable(long txTimestamp, Object newVersion, Comparator comparator)
          Don't overwite already cached items
 ReadWriteCache.Lock lock(long timeout, int id)
          Lock the item
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReadWriteCache.Item

public ReadWriteCache.Item(Object value,
                           Object version,
                           long currentTimestamp)
Method Detail

getFreshTimestamp

public long getFreshTimestamp()
The timestamp on the cached data


getValue

public Object getValue()
The actual cached data


lock

public ReadWriteCache.Lock lock(long timeout,
                                int id)
Lock the item

Specified by:
lock in interface ReadWriteCache.Lockable

isLock

public boolean isLock()
Not a lock!

Specified by:
isLock in interface ReadWriteCache.Lockable

isGettable

public boolean isGettable(long txTimestamp)
Is this item visible to the timestamped transaction?

Specified by:
isGettable in interface ReadWriteCache.Lockable

isPuttable

public boolean isPuttable(long txTimestamp,
                          Object newVersion,
                          Comparator comparator)
Don't overwite already cached items

Specified by:
isPuttable in interface ReadWriteCache.Lockable

toString

public String toString()