org.terracotta.collections
Interface LockStrategy<K>

All Known Implementing Classes:
BasicLockStrategy, HashcodeLockStrategy, NullLockStrategy, OneToOneLockStrategy

public interface LockStrategy<K>


Method Summary
 void beginLock(String lockID, int type)
           
 void commitLock(String lockID, int type)
           
 String generateLockIdForKey(String instanceQualifier, K key)
          Generate the terracotta lock identifier used when performing operations for the given key.
 void pinLock(String lockId)
           
 boolean tryBeginLock(String lockID, int type, long nanos)
           
 void unpinLock(String lock)
           
 

Method Detail

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 lockId
key -
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.