Package com.atlassian.beehive
Interface ClusterLock
- All Superinterfaces:
Lock
Represents a cluster-wide lock.
These are named locks available from com.atlassian.beehive.ClusterLockService.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanQueries if this lock is held by the current thread.voidThis optional operation from the javaLockinterface is not supported in ClusterLock.
-
Method Details
-
isHeldByCurrentThread
boolean isHeldByCurrentThread()Queries if this lock is held by the current thread.This is equivalent to
Thread.holdsLock(Object)for Java's intrinsic monitor locks orReentrantLock.isHeldByCurrentThread().- Returns:
trueif the current thread holds this lock;falseotherwise
-
newCondition
This optional operation from the javaLockinterface is not supported in ClusterLock.- Specified by:
newConditionin interfaceLock- Returns:
- never
- Throws:
UnsupportedOperationException- always
-
lockInterruptibly
WARNING:
ClusterLocksupports interruption of this method on a best-effort basis only. All implementations will report interruption if the interrupted state exists prior to calling this method, but the underlying lock mechanism is not guaranteed to support interruption of an already in-flight lock request. The ability to interrupt a pendinglockInterruptibly()call must not be relied upon for correctness.- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException- if this thread is interrupted before calling this method, or if this thread is interrupted while waiting for the lock and the implementation supports interruption.
-