public static final class AbstractReadWriteAccessStrategy.Lock extends Object implements Serializable, AbstractReadWriteAccessStrategy.Lockable, org.hibernate.cache.spi.access.SoftLock
Wrapper type representing locked items.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Object |
getValue()
Returns the enclosed value.
|
int |
hashCode() |
boolean |
isReadable(long txTimestamp)
Returns <code>true</code> if the enclosed value can be read by a transaction started at the given time.
|
boolean |
isUnlockable(org.hibernate.cache.spi.access.SoftLock lock)
Returns <code>true</code> if the given lock can be unlocked using the given SoftLock instance as a handle.
|
boolean |
isWriteable(long txTimestamp,
Object newVersion,
Comparator versionComparator)
Returns <code>true</code> if the enclosed value can be replaced with one of the given version by a
transaction started at the given time.
|
AbstractReadWriteAccessStrategy.Lock |
lock(long timeout,
UUID uuid,
long lockId)
Locks this entry, stamping it with the UUID and lockId given, with the lock timeout occuring at the specified
time.
|
String |
toString() |
void |
unlock(long timestamp)
Unlocks this Lock, and timestamps the unlock event.
|
boolean |
wasLockedConcurrently()
Returns true if this Lock has been concurrently locked by more than one transaction.
|
public boolean isReadable(long txTimestamp)
AbstractReadWriteAccessStrategy.LockableReturns <code>true</code> if the enclosed value can be read by a transaction started at the given time.
isReadable in interface AbstractReadWriteAccessStrategy.Lockablepublic boolean isWriteable(long txTimestamp,
Object newVersion,
Comparator versionComparator)
AbstractReadWriteAccessStrategy.LockableReturns <code>true</code> if the enclosed value can be replaced with one of the given version by a transaction started at the given time.
isWriteable in interface AbstractReadWriteAccessStrategy.Lockablepublic Object getValue()
AbstractReadWriteAccessStrategy.LockableReturns the enclosed value.
getValue in interface AbstractReadWriteAccessStrategy.Lockablepublic boolean isUnlockable(org.hibernate.cache.spi.access.SoftLock lock)
AbstractReadWriteAccessStrategy.LockableReturns <code>true</code> if the given lock can be unlocked using the given SoftLock instance as a handle.
isUnlockable in interface AbstractReadWriteAccessStrategy.Lockablepublic boolean wasLockedConcurrently()
Returns true if this Lock has been concurrently locked by more than one transaction.
public AbstractReadWriteAccessStrategy.Lock lock(long timeout, UUID uuid, long lockId)
AbstractReadWriteAccessStrategy.LockableLocks this entry, stamping it with the UUID and lockId given, with the lock timeout occuring at the specified time. The returned Lock object can be used to unlock the entry in the future.
lock in interface AbstractReadWriteAccessStrategy.Lockablepublic void unlock(long timestamp)
Unlocks this Lock, and timestamps the unlock event.
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.