|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.locking.strategy.LongLockStrategy<K>
public class LongLockStrategy<K>
| Constructor Summary | |
|---|---|
LongLockStrategy()
|
|
| Method Summary | |
|---|---|
void |
beginLock(Long lockID,
int type)
Called to acquire a lock on the given lockId at the given level. |
void |
commitLock(Long lockID,
int type)
Called to release a lock on the given lockId held at the given level. |
Long |
generateLockIdForKey(String instanceQualifier,
K key)
Generate the lock identifier to be used when performing operations for the given key. |
void |
pinLock(Long lockID)
Called to indicate that the associated lock might be required frequently. |
boolean |
tryBeginLock(Long lockID,
int type,
long nanos)
Called to attempt to acquire a lock on the given lockId at the given level. |
void |
unpinLock(Long 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 LongLockStrategy()
| Method Detail |
|---|
public Long generateLockIdForKey(String instanceQualifier,
K key)
GenericLockStrategy
To prevent inter-map lock collisions the instanceQualifier provided by the caller should be used to form
the key.
generateLockIdForKey in interface GenericLockStrategy<Long,K>instanceQualifier - A unique identifier for the map being operated on.key - key to be locked
public void beginLock(Long lockID,
int type)
GenericLockStrategy
beginLock in interface GenericLockStrategy<Long,K>lockID - lock to locktype - hold type to acquirepublic void pinLock(Long lockID)
GenericLockStrategyThis call can be used to help guide resource allocation and collection.
pinLock in interface GenericLockStrategy<Long,K>public void unpinLock(Long lockId)
GenericLockStrategyThis call can be used to help guide resource allocation and collection.
unpinLock in interface GenericLockStrategy<Long,K>
public void commitLock(Long lockID,
int type)
GenericLockStrategy
commitLock in interface GenericLockStrategy<Long,K>lockID - lock to unlocktype - hold type to release
public boolean tryBeginLock(Long lockID,
int type,
long nanos)
throws InterruptedException
GenericLockStrategy
tryBeginLock in interface GenericLockStrategy<Long,K>lockID - lock to locktype - hold type to acquire
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||