Interface InterProcessTxLock
- All Known Implementing Classes:
NonReentrantMutex
public interface InterProcessTxLock
Similar to an
InterProcessLock,
but we track the locks with specific transaction ids.-
Method Summary
Modifier and TypeMethodDescriptionvoidTries to acquire a lock for a transaction.booleanTries to acquire a lock for a transaction.booleanisAcquired(UUID theTxId) booleanvoidRelease a lock for a transaction.voidRelease all locks for transactions that have been acquired.
-
Method Details
-
acquire
Tries to acquire a lock for a transaction. Each call to acquire for a transaction should be balanced with a call to release with the same transaction id. This method blocks until it is able to obtain the lock.- Parameters:
theTxId-- Throws:
Exception
-
acquire
Tries to acquire a lock for a transaction. Each call to acquire for a transaction should be balanced with a call to release with the same transaction id. This method blocks until the timeout is reached.- Parameters:
theTxId-theTime-theTimeUnit-- Returns:
- Throws:
Exception
-
release
Release a lock for a transaction.- Parameters:
theTxId-- Throws:
Exception
-
isAcquiredByAny
- Returns:
- true if any locks of this type are acquired by any thread/process.
- Throws:
IOException
-
isAcquired
- Returns:
- true if a lock for the specific transaction is acquired by any thread/process.
- Throws:
IOException
-
releaseAll
Release all locks for transactions that have been acquired.- Throws:
Exception
-