org.hibernate.cache

Class ReadWriteCache.Item

Enclosing Class:
ReadWriteCache
Implemented Interfaces:
Serializable, ReadWriteCache.Lockable

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

An item of cached data, timestamped with the time it was cached,.
See Also:
ReadWriteCache

Constructor Summary

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

Constructor Details

Item

public Item(Object value,
            Object version,
            long currentTimestamp)

Method Details

getFreshTimestamp

public long getFreshTimestamp()
The timestamp on the cached data

getValue

public Object getValue()
The actual cached data

isGettable

public boolean isGettable(long txTimestamp)
Is this item visible to the timestamped transaction?
Specified by:
isGettable in interface ReadWriteCache.Lockable

isLock

public boolean isLock()
Not a lock!
Specified by:
isLock 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

lock

public ReadWriteCache.Lock lock(long timeout,
                                int id)
Lock the item
Specified by:
lock in interface ReadWriteCache.Lockable

toString

public String toString()