|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.locking.strategy.BasicLockStrategy<K>
org.terracotta.locking.strategy.NullLockStrategy<K>
public class NullLockStrategy<K>
A non-locking lock strategy.
Using this implementation results in a HashMap like distributed map
which relies on external locking to provide visibility and exclusion
guarantees.
| Constructor Summary | |
|---|---|
NullLockStrategy()
|
|
| Method Summary | |
|---|---|
void |
beginLock(String lockID,
int type)
Called to acquire a lock on the given lockId at the given level. |
void |
commitLock(String lockID,
int type)
Called to release a lock on the given lockId held at the given level. |
String |
generateLockIdForKey(String instanceQualifier,
K key)
Generate the lock identifier to be used when performing operations for the given key. |
void |
pinLock(String lockID)
Called to indicate that the associated lock might be required frequently. |
boolean |
tryBeginLock(String lockID,
int type,
long nanos)
Called to attempt to acquire a lock on the given lockId at the given level. |
void |
unpinLock(String lockID)
Called to indicate that the associated lock is no longer required frequently. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NullLockStrategy()
| Method Detail |
|---|
public String generateLockIdForKey(String instanceQualifier,
K key)
LockStrategy
To prevent inter-map lock collisions the instanceQualifier provided by the caller should be used to form
the key.
instanceQualifier - A unique identifier for the map being operated on.key - key to be locked
public void beginLock(String lockID,
int type)
LockStrategy
beginLock in interface GenericLockStrategy<String,K>beginLock in interface LockStrategy<K>beginLock in class BasicLockStrategy<K>lockID - lock to locktype - hold type to acquire
public void commitLock(String lockID,
int type)
LockStrategy
commitLock in interface GenericLockStrategy<String,K>commitLock in interface LockStrategy<K>commitLock in class BasicLockStrategy<K>lockID - lock to unlocktype - hold type to releasepublic void unpinLock(String lockID)
LockStrategyThis call can be used to help guide resource allocation and collection.
unpinLock in interface GenericLockStrategy<String,K>unpinLock in interface LockStrategy<K>unpinLock in class BasicLockStrategy<K>public void pinLock(String lockID)
LockStrategyThis call can be used to help guide resource allocation and collection.
pinLock in interface GenericLockStrategy<String,K>pinLock in interface LockStrategy<K>pinLock in class BasicLockStrategy<K>
public boolean tryBeginLock(String lockID,
int type,
long nanos)
LockStrategy
tryBeginLock in interface GenericLockStrategy<String,K>tryBeginLock in interface LockStrategy<K>tryBeginLock in class BasicLockStrategy<K>lockID - lock to locktype - hold type to acquire
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||