|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GenericLockStrategy<L,K>
| Method Summary | |
|---|---|
void |
beginLock(L lockID,
int type)
Called to acquire a lock on the given lockId at the given level. |
void |
commitLock(L lockID,
int type)
Called to release a lock on the given lockId held at the given level. |
L |
generateLockIdForKey(String instanceQualifier,
K key)
Generate the lock identifier to be used when performing operations for the given key. |
void |
pinLock(L lockID)
Called to indicate that the associated lock might be required frequently. |
boolean |
tryBeginLock(L lockID,
int type,
long nanos)
Called to attempt to acquire a lock on the given lockId at the given level. |
void |
unpinLock(L lockID)
Called to indicate that the associated lock is no longer required frequently. |
| Method Detail |
|---|
L generateLockIdForKey(String instanceQualifier,
K key)
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
void beginLock(L lockID,
int type)
lockID - lock to locktype - hold type to acquirevoid pinLock(L lockID)
This call can be used to help guide resource allocation and collection.
lockId - lock to `pin'void unpinLock(L lockID)
This call can be used to help guide resource allocation and collection.
lock - lock to `unpin'
void commitLock(L lockID,
int type)
lockID - lock to unlocktype - hold type to release
boolean tryBeginLock(L lockID,
int type,
long nanos)
throws InterruptedException
lockID - lock to locktype - hold type to acquiretime - to wait for lock in nanoseconds
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||