org.terracotta.locking.strategy
Class OneToOneLockStrategy
java.lang.Object
org.terracotta.locking.strategy.BasicLockStrategy<String>
org.terracotta.locking.strategy.OneToOneLockStrategy
- All Implemented Interfaces:
- GenericLockStrategy<String,String>, LockStrategy<String>
public class OneToOneLockStrategy
- extends BasicLockStrategy<String>
A String key only lock strategy where locking is performed on a
concatentation of the the instance qualifier and the string key itself.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OneToOneLockStrategy
public OneToOneLockStrategy()
generateLockIdForKey
public String generateLockIdForKey(String instanceQualifier,
String key)
- Description copied from interface:
LockStrategy
- Generate the lock identifier to be used when performing operations for the given key.
To prevent inter-map lock collisions the instanceQualifier provided by the caller should be used to form
the key.
- Parameters:
instanceQualifier - A unique identifier for the map being operated on.key - key to be locked
- Returns:
- lock identifier
Copyright © 2015 Terracotta, Inc.. All Rights Reserved.