public static final class AbstractReadWriteAccessStrategy.Lock extends java.lang.Object implements java.io.Serializable, AbstractReadWriteAccessStrategy.Lockable, SoftLock
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Object |
getValue()
Returns the enclosed value.
|
int |
hashCode() |
boolean |
isReadable(long txTimestamp)
Returns
true if the enclosed value can be read by a transaction started at the given time. |
boolean |
isUnlockable(SoftLock lock)
Returns
true if the given lock can be unlocked using the given SoftLock instance as a handle. |
boolean |
isWriteable(long txTimestamp,
java.lang.Object newVersion,
java.util.Comparator versionComparator)
Returns
true 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,
java.util.UUID uuid,
long lockId)
Locks this entry, stamping it with the UUID and lockId given, with the lock timeout occuring at the specified
time.
|
java.lang.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.Lockabletrue if the enclosed value can be read by a transaction started at the given time.isReadable in interface AbstractReadWriteAccessStrategy.Lockablepublic boolean isWriteable(long txTimestamp,
java.lang.Object newVersion,
java.util.Comparator versionComparator)
AbstractReadWriteAccessStrategy.Lockabletrue 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 java.lang.Object getValue()
AbstractReadWriteAccessStrategy.LockablegetValue in interface AbstractReadWriteAccessStrategy.Lockablepublic boolean isUnlockable(SoftLock lock)
AbstractReadWriteAccessStrategy.Lockabletrue if the given lock can be unlocked using the given SoftLock instance as a handle.isUnlockable in interface AbstractReadWriteAccessStrategy.Lockablepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean wasLockedConcurrently()
public AbstractReadWriteAccessStrategy.Lock lock(long timeout, java.util.UUID uuid, long lockId)
AbstractReadWriteAccessStrategy.Lockablelock in interface AbstractReadWriteAccessStrategy.Lockablepublic void unlock(long timestamp)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.