public abstract class AbstractSoftLockManager extends Object implements SoftLockManager
Constructor and Description |
---|
AbstractSoftLockManager(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
|
Set<SoftLock> |
collectAllSoftLocksForTransactionID(TransactionID transactionID)
Get a the soft locks of the specified transaction ID
|
SoftLockID |
createSoftLockID(TransactionID transactionID,
Object key,
Element newElement,
Element oldElement)
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 ConcurrentMap<SoftLockID,SoftLock> |
getAllLocks()
Return the map of all soft locks.
|
Set<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 ConcurrentMap<SoftLockID,Boolean> |
getNewKeyLocks()
Return the map of all locks that are for new keys.
|
public AbstractSoftLockManager(String cacheName, SoftLockFactory lockFactory)
cacheName
- name of the cachelockFactory
- factory of managed locksprotected abstract ConcurrentMap<SoftLockID,SoftLock> getAllLocks()
protected abstract ConcurrentMap<SoftLockID,Boolean> getNewKeyLocks()
public SoftLockID createSoftLockID(TransactionID transactionID, Object key, Element newElement, Element oldElement)
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 Elementpublic SoftLock findSoftLockById(SoftLockID softLockId)
findSoftLockById
in interface SoftLockManager
softLockId
- the soft lock's IDpublic Set<Object> getKeysInvisibleInContext(LocalTransactionContext currentTransactionContext, Store underlyingStore)
getKeysInvisibleInContext
in interface SoftLockManager
currentTransactionContext
- the transaction contextpublic 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 clearCopyright © 2003–2016 Terracotta, Inc.. All rights reserved.