org.terracotta.collections
Interface LockStrategy<K>
- All Known Implementing Classes:
- BasicLockStrategy, HashcodeLockStrategy, NullLockStrategy, OneToOneLockStrategy
public interface LockStrategy<K>
generateLockIdForKey
String generateLockIdForKey(String instanceQualifier,
K key)
- Generate the terracotta lock identifier used when performing operations for the given key.
- Parameters:
instanceQualifier - A unique identifier for the map being operated on. To avoid lock collisions with other
maps, this identifier should be part of the return lockIdkey -
- Returns:
- lock identifier
beginLock
void beginLock(String lockID,
int type)
pinLock
void pinLock(String lockId)
unpinLock
void unpinLock(String lock)
commitLock
void commitLock(String lockID,
int type)
tryBeginLock
boolean tryBeginLock(String lockID,
int type,
long nanos)
throws InterruptedException
- Throws:
InterruptedException
Copyright © 2010 Terracotta, Inc.. All Rights Reserved.