Package org.hibernate.cache.spi.support
Class AbstractReadWriteAccess.Item
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractReadWriteAccess.Item
-
- All Implemented Interfaces:
Serializable
,AbstractReadWriteAccess.Lockable
- Enclosing class:
- AbstractReadWriteAccess
public static final class AbstractReadWriteAccess.Item extends Object implements Serializable, AbstractReadWriteAccess.Lockable
Wrapper type representing unlocked items.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getValue()
Returns the enclosed value.boolean
isReadable(long txTimestamp)
Returnstrue
if the enclosed value can be read by a transaction started at the given time.boolean
isUnlockable(SoftLock lock)
Returnstrue
if the given lock can be unlocked using the given SoftLock instance as a handle.boolean
isWriteable(long txTimestamp, Object newVersion, Comparator versionComparator)
Returnstrue
if the enclosed value can be replaced with one of the given version by a transaction started at the given time.AbstractReadWriteAccess.SoftLockImpl
lock(long timeout, UUID uuid, long lockId)
Locks this entry, stamping it with the UUID and lockId given, with the lock timeout occurring at the specified time.String
toString()
-
-
-
Method Detail
-
isReadable
public boolean isReadable(long txTimestamp)
Description copied from interface:AbstractReadWriteAccess.Lockable
Returnstrue
if the enclosed value can be read by a transaction started at the given time.- Specified by:
isReadable
in interfaceAbstractReadWriteAccess.Lockable
-
isWriteable
public boolean isWriteable(long txTimestamp, Object newVersion, Comparator versionComparator)
Description copied from interface:AbstractReadWriteAccess.Lockable
Returnstrue
if the enclosed value can be replaced with one of the given version by a transaction started at the given time.- Specified by:
isWriteable
in interfaceAbstractReadWriteAccess.Lockable
-
getValue
public Object getValue()
Description copied from interface:AbstractReadWriteAccess.Lockable
Returns the enclosed value.- Specified by:
getValue
in interfaceAbstractReadWriteAccess.Lockable
-
isUnlockable
public boolean isUnlockable(SoftLock lock)
Description copied from interface:AbstractReadWriteAccess.Lockable
Returnstrue
if the given lock can be unlocked using the given SoftLock instance as a handle.- Specified by:
isUnlockable
in interfaceAbstractReadWriteAccess.Lockable
-
lock
public AbstractReadWriteAccess.SoftLockImpl lock(long timeout, UUID uuid, long lockId)
Description copied from interface:AbstractReadWriteAccess.Lockable
Locks this entry, stamping it with the UUID and lockId given, with the lock timeout occurring at the specified time. The returned Lock object can be used to unlock the entry in the future.- Specified by:
lock
in interfaceAbstractReadWriteAccess.Lockable
-
-