|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LockManager
An interface to deal with all aspects of acquiring and releasing locks for cache entries.
| Method Summary | |
|---|---|
Object |
getLockOwner(InvocationContext ctx)
Determines the owner to be used when obtaining locks, given an invocation context. |
Object |
getOwner(Object key)
Retrieves the write lock owner, if any, for the specified cache entry. |
boolean |
isLocked(Object key)
Returns true if the cache entry is locked (either for reading or writing) by anyone, and false otherwise. |
boolean |
lockAndRecord(Object key,
InvocationContext ctx)
Acquires a lock of type lockType, on a specific entry in the cache. |
boolean |
ownsLock(Object key,
Object owner)
Tests whether a given owner owns a lock of lockType on a particular cache entry. |
boolean |
possiblyLocked(CacheEntry entry)
Inspects the entry for signs that it is possibly locked, and hence would need to be unlocked. |
String |
printLockInfo()
Prints lock information for all locks. |
void |
unlock(InvocationContext ctx)
Releases locks present in an invocation context and transaction entry, if one is available. |
void |
unlock(Object key,
Object owner)
Releases the lock passed in, held by the specified owner |
| Method Detail |
|---|
Object getLockOwner(InvocationContext ctx)
GlobalTransaction if one is present in the context, or Thread.currentThread() if
one is not present.
ctx - invocation context
boolean lockAndRecord(Object key,
InvocationContext ctx)
throws InterruptedException
Configuration.getLockAcquisitionTimeout().
The owner for the lock is determined by passing the invocation context to getLockOwner(InvocationContext).
key - key to lockctx - invocation context associated with this invocation
InterruptedException - if interrupted
void unlock(Object key,
Object owner)
owner - lock ownervoid unlock(InvocationContext ctx)
getLockOwner(InvocationContext)
ctx - invocation context to inspect
boolean ownsLock(Object key,
Object owner)
owner - owner
boolean isLocked(Object key)
Object getOwner(Object key)
String printLockInfo()
boolean possiblyLocked(CacheEntry entry)
entry - entry to inspect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||