|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TerracottaLocking
| Method Summary | |
|---|---|
LockID |
generateLockIdentifier(java.lang.Object obj)
|
LockID |
generateLockIdentifier(java.lang.Object obj,
java.lang.String field)
|
LockID |
generateLockIdentifier(java.lang.String str)
|
int |
globalHoldCount(LockID lock,
LockLevel level)
Return the count of global (cluster-wide) holders at the given lock level. |
int |
globalPendingCount(LockID lock)
Return the count of global (cluster-wide) pending holders. |
int |
globalWaitingCount(LockID lock)
Return the count of global (cluster-wide) waiting threads. |
boolean |
isLocked(LockID lock,
LockLevel level)
Return true if the given lock is held by any thread at the given lock level. |
boolean |
isLockedByCurrentThread(LockID lock,
LockLevel level)
Return true if the given lock is held by the current thread at the given lock level. |
boolean |
isLockedByCurrentThread(LockLevel level)
Return true if any lock is held by the current thread at the given lock level. |
int |
localHoldCount(LockID lock,
LockLevel level)
Return the count of local (on this client VM) holders at the given lock level. |
void |
lock(LockID lock,
LockLevel level)
Blocking acquire of a Terracotta lock. |
void |
lockInterruptibly(LockID lock,
LockLevel level)
Interruptible acquire of a Terracotta lock. |
Notify |
notify(LockID lock,
java.lang.Object waitObject)
Notify a single thread waiting on the given lock. |
Notify |
notifyAll(LockID lock,
java.lang.Object waitObject)
Notify all threads waiting on the given lock. |
void |
pinLock(LockID lock)
|
boolean |
tryLock(LockID lock,
LockLevel level)
Try to acquire a Terracotta lock. |
boolean |
tryLock(LockID lock,
LockLevel level,
long timeout)
Timed acquire of a Terracotta lock. |
void |
unlock(LockID lock,
LockLevel level)
Blocking unlock of a Terracotta lock. |
void |
unpinLock(LockID lock)
|
void |
wait(LockID lock,
java.lang.Object waitObject)
Move the current thread to wait on the given lock. |
void |
wait(LockID lock,
java.lang.Object waitObject,
long timeout)
Move the current thread to wait on the given lock with timeout. |
| Method Detail |
|---|
void lock(LockID lock,
LockLevel level)
lock - lock to act uponlevel - level at which to lock
TCLockUpgradeNotSupportedError - on attempting to read→write upgrade
boolean tryLock(LockID lock,
LockLevel level)
Non-blocking try acquires will wait for a definitive server response - in this sense they are not truly non-blocking...
lock - lock to act uponlevel - level at which to lock
true if locked
TCLockUpgradeNotSupportedError - on attempting to read→write upgrade
boolean tryLock(LockID lock,
LockLevel level,
long timeout)
throws java.lang.InterruptedException
lock - lock to act uponlevel - level at which to locktimeout - maximum time to wait in milliseconds
true if locked
TCLockUpgradeNotSupportedError - on attempting to read→write upgrade
java.lang.InterruptedException
void lockInterruptibly(LockID lock,
LockLevel level)
throws java.lang.InterruptedException
lock - lock to act uponlevel - level at which to lock
TCLockUpgradeNotSupportedError - on attempting to read→write upgrade
java.lang.InterruptedException
void unlock(LockID lock,
LockLevel level)
lock - lock to act uponlevel - at which to unlock
java.lang.IllegalMonitorStateException - if there is no matching lock hold
Notify notify(LockID lock,
java.lang.Object waitObject)
lock - lock to act uponwaitObject - local vm object on which threads are waiting
java.lang.IllegalMonitorStateException - if the current thread does not hold a write lock
Notify notifyAll(LockID lock,
java.lang.Object waitObject)
lock - lock to act uponwaitObject - local vm object on which threads are waiting
java.lang.IllegalMonitorStateException - if the current thread does not hold a write lock
void wait(LockID lock,
java.lang.Object waitObject)
throws java.lang.InterruptedException
lock - lock to act uponwaitObject - local vm object to wait on
java.lang.IllegalMonitorStateException - if the current thread does not hold a write lock
java.lang.InterruptedException
void wait(LockID lock,
java.lang.Object waitObject,
long timeout)
throws java.lang.InterruptedException
lock - lock to act uponwaitObject - local vm object to wait ontimeout - maximum time to remain waiting
java.lang.IllegalMonitorStateException - if the current thread does not hold a write lock
java.lang.InterruptedException
boolean isLocked(LockID lock,
LockLevel level)
The semantics of this method are fairly loose when using a greedy locking policy. It is assumed that a client holding a greedy lock has in turn one holding thread of each possible type.
It is also important to note that the current locking implementation does not track concurrent lock holds.
lock - lock to querylevel - level to query
boolean isLockedByCurrentThread(LockID lock,
LockLevel level)
It is also important to note that the current locking implementation does not track concurrent lock holds.
lock - lock to querylevel - level to queryboolean isLockedByCurrentThread(LockLevel level)
It is also important to note that the current locking implementation does not track concurrent lock holds.
level - level to query
int localHoldCount(LockID lock,
LockLevel level)
lock - lock to querylevel - level to query
int globalHoldCount(LockID lock,
LockLevel level)
This method has unusual semantics similar to isLocked.
lock - lock to querylevel - level to queryisLocked(LockID, LockLevel)int globalPendingCount(LockID lock)
This method has unusual semantics similar to isLocked.
lock - lock to queryisLocked(LockID, LockLevel)int globalWaitingCount(LockID lock)
This method has unusual semantics similar to isLocked.
lock - lock to queryisLocked(LockID, LockLevel)void pinLock(LockID lock)
void unpinLock(LockID lock)
LockID generateLockIdentifier(java.lang.String str)
LockID generateLockIdentifier(java.lang.Object obj)
LockID generateLockIdentifier(java.lang.Object obj,
java.lang.String field)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||