ehcache

net.sf.ehcache.transaction
Interface SoftLockManager

All Known Implementing Classes:
AbstractSoftLockManager, SoftLockManagerImpl

public interface SoftLockManager

A factory for SoftLocks

Author:
Ludovic Orban

Method Summary
 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
 Set<Object> getKeysInvisibleInContext(LocalTransactionContext transactionContext, 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.
 

Method Detail

createSoftLockID

SoftLockID createSoftLockID(TransactionID transactionID,
                            Object key,
                            Element newElement,
                            Element oldElement)
Create a new soft lock ID and associated soft lock if necessary.

Parameters:
transactionID - the transaction ID under which the soft lock will operate
key - the key of the Element this soft lock is protecting
newElement - the new Element
oldElement - the actual Element
Returns:
the soft lock ID

clearSoftLock

void clearSoftLock(SoftLock softLock)
Clear a soft lock

Parameters:
softLock - the lock to clear

findSoftLockById

SoftLock findSoftLockById(SoftLockID softLockId)
Find a previously created and still existing soft lock

Parameters:
softLockId - the soft lock's ID
Returns:
the soft lock, or null if no soft lock with the corresponding ID could be found

getKeysInvisibleInContext

Set<Object> getKeysInvisibleInContext(LocalTransactionContext transactionContext,
                                      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.

Parameters:
transactionContext - the transaction context
Returns:
a Set of keys invisible to the context

collectAllSoftLocksForTransactionID

Set<SoftLock> collectAllSoftLocksForTransactionID(TransactionID transactionID)
Get a the soft locks of the specified transaction ID

Parameters:
transactionID - the transaction ID
Returns:
a Set of SoftLocks

ehcache

Copyright 2001-2015, Terracotta, Inc.