protected static final class AbstractReadWriteEhcacheAccessStrategy.Item extends java.lang.Object implements java.io.Serializable, AbstractReadWriteEhcacheAccessStrategy.Lockable
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
private long |
timestamp |
private java.lang.Object |
value |
private java.lang.Object |
version |
Constructor and Description |
---|
Item(java.lang.Object value,
java.lang.Object version,
long timestamp)
Creates an unlocked item wrapping the given value with a version and creation timestamp.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue()
Returns the enclosed value.
|
boolean |
isReadable(long txTimestamp)
Returns
true if the enclosed value can be read by a transaction started at the given time. |
boolean |
isUnlockable(org.hibernate.cache.access.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. |
AbstractReadWriteEhcacheAccessStrategy.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.
|
private static final long serialVersionUID
private final java.lang.Object value
private final java.lang.Object version
private final long timestamp
Item(java.lang.Object value, java.lang.Object version, long timestamp)
public boolean isReadable(long txTimestamp)
true
if the enclosed value can be read by a transaction started at the given time.isReadable
in interface AbstractReadWriteEhcacheAccessStrategy.Lockable
public boolean isWriteable(long txTimestamp, java.lang.Object newVersion, java.util.Comparator versionComparator)
true
if the enclosed value can be replaced with one of the given version by a
transaction started at the given time.isWriteable
in interface AbstractReadWriteEhcacheAccessStrategy.Lockable
public java.lang.Object getValue()
getValue
in interface AbstractReadWriteEhcacheAccessStrategy.Lockable
public boolean isUnlockable(org.hibernate.cache.access.SoftLock lock)
true
if the given lock can be unlocked using the given SoftLock instance as a handle.isUnlockable
in interface AbstractReadWriteEhcacheAccessStrategy.Lockable
public AbstractReadWriteEhcacheAccessStrategy.Lock lock(long timeout, java.util.UUID uuid, long lockId)
lock
in interface AbstractReadWriteEhcacheAccessStrategy.Lockable