org.hibernate.cache
Class ReadWriteCache.Lock
java.lang.Object
org.hibernate.cache.ReadWriteCache.Lock
- ReadWriteCache
- Serializable, ReadWriteCache.Lockable, SoftLock
public static final class ReadWriteCache.Lock
extends java.lang.Object
A soft lock which supports concurrent locking,
timestamped with the time it was released
Lock(long timeout, int id, Object version)
|
int | getId()
|
long | getUnlockTimestamp()
|
boolean | isGettable(long txTimestamp) - locks are not returned to the client!
|
boolean | isLock() - Yes, this is a lock
|
boolean | isPuttable(long txTimestamp, Object newVersion, Comparator comparator) - Can the timestamped transaction re-cache this
locked item now?
|
ReadWriteCache.Lock | lock(long timeout, int id) - Increment the lock, setting the
new lock timeout
|
String | toString()
|
void | unlock(long currentTimestamp) - Decrement the lock, setting the unlock
timestamp if now unlocked
|
boolean | wasLockedConcurrently() - Was this lock held concurrently by multiple
transactions?
|
Lock
public Lock(long timeout,
int id,
Object version)
getUnlockTimestamp
public long getUnlockTimestamp()
isPuttable
public boolean isPuttable(long txTimestamp,
Object newVersion,
Comparator comparator)
Can the timestamped transaction re-cache this
locked item now?
- isPuttable in interface ReadWriteCache.Lockable
toString
public String toString()
unlock
public void unlock(long currentTimestamp)
Decrement the lock, setting the unlock
timestamp if now unlocked
wasLockedConcurrently
public boolean wasLockedConcurrently()
Was this lock held concurrently by multiple
transactions?