ehcache

net.sf.ehcache.transaction
Interface SoftLockFactory

All Known Implementing Classes:
ReadCommittedSoftLockFactoryImpl

public interface SoftLockFactory

A factory for SoftLocks

Author:
Ludovic Orban

Method Summary
 Set<SoftLock> collectAllSoftLocksForTransactionID(TransactionID transactionID)
          Get a the soft locks of the specified transaction ID
 Set<TransactionID> collectExpiredTransactionIDs()
          Get a Set of TransactionIDs for which the soft locks have expired
 SoftLock createSoftLock(TransactionID transactionID, Object key, Element newElement, Element oldElement, boolean pinned)
          Create a new, unlocked soft lock
 Set<Object> getKeysInvisibleInContext(LocalTransactionContext transactionContext)
          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

createSoftLock

SoftLock createSoftLock(TransactionID transactionID,
                        Object key,
                        Element newElement,
                        Element oldElement,
                        boolean pinned)
Create a new, unlocked soft lock

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
pinned - true if the element that is going to be replaced by a soft lock is pinned
Returns:
the soft lock

getKeysInvisibleInContext

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

collectExpiredTransactionIDs

Set<TransactionID> collectExpiredTransactionIDs()
Get a Set of TransactionIDs for which the soft locks have expired

Returns:
a Set of TransactionIDs for which the soft locks have expired

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 © 2003-2012 Terracotta, Inc.. All Rights Reserved.