org.terracotta.locking
Interface LockableMap<K>

Type Parameters:
K - key type
All Known Subinterfaces:
ClusteredMap<K,V>, DistributedCache<K,V>, IncoherentDistributedCache<K,V>, IncoherentDistributedCacheInternals<K,V>
All Known Implementing Classes:
ConcurrentDistributedMap, ConcurrentDistributedServerMap, EnterpriseConcurrentDistributedMap, LocalCache, TerracottaDistributedCache

public interface LockableMap<K>

Instances of LockableMap can have their individual entries independently locked and unlocked. This allows the implementation of atomic operations with arbitrary contents.

Author:
Chris Dennis

Method Summary
 ClusteredLock createFinegrainedLock(K key)
          Obtain a fine-grained lock instance for a particular key.
 void lockEntry(K key)
          Lock the entry corresponding to this key.
 void unlockEntry(K key)
          Unlock the entry corresponding to this key
 

Method Detail

createFinegrainedLock

ClusteredLock createFinegrainedLock(K key)
Obtain a fine-grained lock instance for a particular key.

Parameters:
key - the key for which a fine-grained lock has to be constructed
Returns:
an instance of fine-grained lock that can be used to perform primitive locking operations on a key

lockEntry

void lockEntry(K key)
Lock the entry corresponding to this key.

Parameters:
key - the key for which all entry accesses have to be locked

unlockEntry

void unlockEntry(K key)
Unlock the entry corresponding to this key

Parameters:
key - the key for which all entry accesses have to be unlocked


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.