org.hibernate.cache
Class ReadWriteCache.Item

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

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

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

See Also:
ReadWriteCache, Serialized Form

Constructor Summary
ReadWriteCache.Item(java.lang.Object value, java.lang.Object version, long currentTimestamp)
           
 
Method Summary
 long getFreshTimestamp()
          The timestamp on the cached data
 java.lang.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, java.lang.Object newVersion, java.util.Comparator comparator)
          Don't overwite already cached items
 ReadWriteCache.Lock lock(long timeout, int id)
          Lock the item
 java.lang.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(java.lang.Object value,
                           java.lang.Object version,
                           long currentTimestamp)
Method Detail

getFreshTimestamp

public long getFreshTimestamp()
The timestamp on the cached data


getValue

public java.lang.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,
                          java.lang.Object newVersion,
                          java.util.Comparator comparator)
Don't overwite already cached items

Specified by:
isPuttable in interface ReadWriteCache.Lockable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008 Hibernate.org. All Rights Reserved.