|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.lock.LockManagerImpl
public class LockManagerImpl
Handles locks for the MVCC based LockingInterceptor
| Field Summary | |
|---|---|
protected Configuration |
configuration
|
| Constructor Summary | |
|---|---|
LockManagerImpl()
|
|
| Method Summary | |
|---|---|
int |
getConcurrencyLevel()
|
Object |
getLockOwner(InvocationContext ctx)
Determines the owner to be used when obtaining locks, given an invocation context. |
int |
getNumberOfLocksAvailable()
|
int |
getNumberOfLocksHeld()
|
Object |
getOwner(Object key)
Retrieves the write lock owner, if any, for the specified cache entry. |
void |
injectDependencies(Configuration configuration,
TransactionManager transactionManager,
InvocationContextContainer invocationContextContainer)
|
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 |
startLockManager()
|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Configuration configuration
| Constructor Detail |
|---|
public LockManagerImpl()
| Method Detail |
|---|
public void injectDependencies(Configuration configuration,
TransactionManager transactionManager,
InvocationContextContainer invocationContextContainer)
public void startLockManager()
public Object getLockOwner(InvocationContext ctx)
LockManagerGlobalTransaction if one is present in the context, or Thread.currentThread() if
one is not present.
getLockOwner in interface LockManagerctx - invocation context
public boolean lockAndRecord(Object key,
InvocationContext ctx)
throws InterruptedException
LockManagerConfiguration.getLockAcquisitionTimeout().
The owner for the lock is determined by passing the invocation context to LockManager.getLockOwner(InvocationContext).
lockAndRecord in interface LockManagerkey - key to lockctx - invocation context associated with this invocation
InterruptedException - if interrupted
public void unlock(Object key,
Object owner)
LockManager
unlock in interface LockManagerowner - lock ownerpublic void unlock(InvocationContext ctx)
LockManagerLockManager.getLockOwner(InvocationContext)
unlock in interface LockManagerctx - invocation context to inspect
public boolean ownsLock(Object key,
Object owner)
LockManager
ownsLock in interface LockManagerowner - owner
public boolean isLocked(Object key)
LockManager
isLocked in interface LockManagerpublic Object getOwner(Object key)
LockManager
getOwner in interface LockManagerpublic String printLockInfo()
LockManager
printLockInfo in interface LockManagerpublic final boolean possiblyLocked(CacheEntry entry)
LockManager
possiblyLocked in interface LockManagerentry - entry to inspect
public int getConcurrencyLevel()
public int getNumberOfLocksHeld()
public int getNumberOfLocksAvailable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||