public abstract class AbstractSoftLockManager extends java.lang.Object implements SoftLockManager
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
cacheName |
private SoftLockFactory |
lockFactory |
Constructor and Description |
---|
AbstractSoftLockManager(java.lang.String cacheName,
SoftLockFactory lockFactory)
Create an abstract soft lock manager for the given cache name and soft lock factory.
|
Modifier and Type | Method and Description |
---|---|
void |
clearSoftLock(SoftLock softLock)
Clear a soft lock
|
java.util.Set<SoftLock> |
collectAllSoftLocksForTransactionID(TransactionID transactionID)
Get a the soft locks of the specified transaction ID
|
SoftLockID |
createSoftLockID(TransactionID transactionID,
java.lang.Object key,
Element newElement,
Element oldElement,
boolean pinned)
Create a new soft lock ID and associated soft lock if necessary.
|
SoftLock |
findSoftLockById(SoftLockID softLockId)
Find a previously created and still existing soft lock
|
protected abstract java.util.concurrent.ConcurrentMap<SoftLockID,SoftLock> |
getAllLocks()
Return the map of all soft locks.
|
java.util.Set<java.lang.Object> |
getKeysInvisibleInContext(LocalTransactionContext currentTransactionContext,
Store underlyingStore)
Get a Set of keys protected by soft locks which must not be visible to a transaction context
according to the isolation level.
|
protected abstract java.util.concurrent.ConcurrentMap<SoftLockID,java.lang.Boolean> |
getNewKeyLocks()
Return the map of all locks that are for new keys.
|
private java.util.Set<java.lang.Object> |
getNewKeys() |
private final java.lang.String cacheName
private final SoftLockFactory lockFactory
public AbstractSoftLockManager(java.lang.String cacheName, SoftLockFactory lockFactory)
cacheName
- name of the cachelockFactory
- factory of managed locksprotected abstract java.util.concurrent.ConcurrentMap<SoftLockID,SoftLock> getAllLocks()
protected abstract java.util.concurrent.ConcurrentMap<SoftLockID,java.lang.Boolean> getNewKeyLocks()
public SoftLockID createSoftLockID(TransactionID transactionID, java.lang.Object key, Element newElement, Element oldElement, boolean pinned)
createSoftLockID
in interface SoftLockManager
transactionID
- the transaction ID under which the soft lock will operatekey
- the key of the Element this soft lock is protectingnewElement
- the new ElementoldElement
- the actual Elementpinned
- true if the actual Element is pinnedpublic SoftLock findSoftLockById(SoftLockID softLockId)
findSoftLockById
in interface SoftLockManager
softLockId
- the soft lock's IDpublic java.util.Set<java.lang.Object> getKeysInvisibleInContext(LocalTransactionContext currentTransactionContext, Store underlyingStore)
getKeysInvisibleInContext
in interface SoftLockManager
currentTransactionContext
- the transaction contextpublic java.util.Set<SoftLock> collectAllSoftLocksForTransactionID(TransactionID transactionID)
collectAllSoftLocksForTransactionID
in interface SoftLockManager
transactionID
- the transaction IDpublic void clearSoftLock(SoftLock softLock)
clearSoftLock
in interface SoftLockManager
softLock
- the lock to clearprivate java.util.Set<java.lang.Object> getNewKeys()