| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| private final ReentrantReadWriteLock | |
| private final Object | |
| private final ReentrantLock | |
| private final SoftLockManager | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv | ReadCommittedSoftLockImpl(SoftLockManager
the creating manager manager, Object the element's key this soft lock is going to protect key)Create a new ReadCommittedSoftLockImpl instance |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | clearTryLock()
Implements net. |
| public void | |
| public Element | getElement(TransactionID
the current transaction under which this call is executed currentTransactionId, SoftLockID the soft lock ID softLockId)Implements net. |
| public Object | getKey()
Implements net. |
| public boolean | isExpired()
Implements net. |
| private boolean | |
| private boolean | |
| public void | |
| public String | |
| public boolean | tryLock(long
the time in milliseconds before this method gives up ms)Implements net. |
| public void | |
| public void |
| expired | back to summary |
|---|---|
| private volatile boolean expired | |
| freezeLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock freezeLock | |
| key | back to summary |
|---|---|
| private final Object key | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| manager | back to summary |
|---|---|
| private final SoftLockManager manager | |
| PRIME | back to summary |
|---|---|
| private static final int PRIME | |
| ReadCommittedSoftLockImpl | back to summary |
|---|---|
| pack-priv ReadCommittedSoftLockImpl(SoftLockManager manager, Object key) Create a new ReadCommittedSoftLockImpl instance
| |
| clear | back to summary |
|---|---|
| private void clear() | |
| clearTryLock | back to summary |
|---|---|
| public void clearTryLock() Implements net. Doc from net. Clear the state of the soft lock after a tryLock() call succeeded. | |
| freeze | back to summary |
|---|---|
| public void freeze() Implements net. Doc from net. Freeze the soft lock. A soft lock should only be frozen for a very short period of time as this blocks
the | |
| getElement | back to summary |
|---|---|
| public Element getElement(TransactionID currentTransactionId, SoftLockID softLockId) Implements net. Doc from net. Get the element the current transaction is supposed to see.
| |
| getKey | back to summary |
|---|---|
| public Object getKey() Implements net. Doc from net. Get the key of the element this soft lock is guarding
| |
| isExpired | back to summary |
|---|---|
| public boolean isExpired() Implements net. Doc from net. Check if the soft lock expired, ie: that the thread which locked it died
| |
| isFrozen | back to summary |
|---|---|
| private boolean isFrozen() | |
| isLocked | back to summary |
|---|---|
| private boolean isLocked() | |
| lock | back to summary |
|---|---|
| public void lock() Implements net. Doc from net. Lock the soft lock | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| tryLock | back to summary |
|---|---|
| public boolean tryLock(long ms) throws InterruptedException Implements net. Doc from net. Attempt to lock the soft lock
| |
| unfreeze | back to summary |
|---|---|
| public void unfreeze() Implements net. Doc from net. Unfreeze the soft lock | |
| unlock | back to summary |
|---|---|
| public void unlock() Implements net. Doc from net. Unlock the soft lock. Once a soft lock got unlocked, it is considered 'dead': it cannot be locked again and must be cleaned up | |