org.terracotta.locking.strategy
Class HashcodeLockStrategy
java.lang.Object
org.terracotta.locking.strategy.BasicLockStrategy<Object>
org.terracotta.locking.strategy.HashcodeLockStrategy
- All Implemented Interfaces:
- GenericLockStrategy<String,Object>, LockStrategy<Object>
public class HashcodeLockStrategy
- extends BasicLockStrategy<Object>
A simple lock strategy where locks are taken on a concatentation of the
instance qualifier and the key's hashcode.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HashcodeLockStrategy
public HashcodeLockStrategy()
generateLockIdForKey
public String generateLockIdForKey(String instanceQualifier,
Object 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.