Package org.hibernate.cache
Class ReadWriteCache.Lock
java.lang.Object
org.hibernate.cache.ReadWriteCache.Lock
- All Implemented Interfaces:
Serializable,SoftLock,ReadWriteCache.Lockable
- Enclosing class:
ReadWriteCache
public static final class ReadWriteCache.Lock
extends Object
implements Serializable, ReadWriteCache.Lockable, SoftLock
A soft lock which supports concurrent locking,
timestamped with the time it was released
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetId()longbooleanisGettable(long txTimestamp) locks are not returned to the client!booleanisLock()Yes, this is a lockbooleanisPuttable(long txTimestamp, Object newVersion, Comparator comparator) Can the timestamped transaction re-cache this locked item now?lock(long timeout, int id) Increment the lock, setting the new lock timeouttoString()voidunlock(long currentTimestamp) Decrement the lock, setting the unlock timestamp if now unlockedbooleanWas this lock held concurrently by multiple transactions?
-
Constructor Details
-
Lock
-
-
Method Details
-
getUnlockTimestamp
public long getUnlockTimestamp() -
lock
Increment the lock, setting the new lock timeout- Specified by:
lockin interfaceReadWriteCache.Lockable
-
unlock
public void unlock(long currentTimestamp) Decrement the lock, setting the unlock timestamp if now unlocked- Parameters:
currentTimestamp-
-
isPuttable
Can the timestamped transaction re-cache this locked item now?- Specified by:
isPuttablein interfaceReadWriteCache.Lockable
-
wasLockedConcurrently
public boolean wasLockedConcurrently()Was this lock held concurrently by multiple transactions? -
isLock
public boolean isLock()Yes, this is a lock- Specified by:
isLockin interfaceReadWriteCache.Lockable
-
isGettable
public boolean isGettable(long txTimestamp) locks are not returned to the client!- Specified by:
isGettablein interfaceReadWriteCache.Lockable
-
getId
public int getId() -
toString
-