|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.locking.strategy.BasicLockStrategy<K>
K - supported key type.public abstract class BasicLockStrategy<K>
A simple always locking abstract LockStrategy.
Subclasses need only implement a method for lock string generation in order to have a fully functional lock strategy.
| Constructor Summary | |
|---|---|
BasicLockStrategy()
|
|
| 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. |
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 |
| Methods inherited from interface org.terracotta.locking.LockStrategy |
|---|
generateLockIdForKey |
| Constructor Detail |
|---|
public BasicLockStrategy()
| Method Detail |
|---|
public void beginLock(String lockID,
int type)
LockStrategy
beginLock in interface GenericLockStrategy<String,K>beginLock in interface LockStrategy<K>lockID - lock to locktype - hold type to acquirepublic 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>public 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>
public void commitLock(String lockID,
int type)
LockStrategy
commitLock in interface GenericLockStrategy<String,K>commitLock in interface LockStrategy<K>lockID - lock to unlocktype - hold type to release
public boolean tryBeginLock(String lockID,
int type,
long nanos)
throws InterruptedException
LockStrategy
tryBeginLock in interface GenericLockStrategy<String,K>tryBeginLock in interface LockStrategy<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 | |||||||||