Interface InterProcessTxLock
-
- All Known Implementing Classes:
NonReentrantMutex
public interface InterProcessTxLockSimilar to anInterProcessLock, but we track the locks with specific transaction ids.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidacquire(java.util.UUID theTxId)Tries to acquire a lock for a transaction.booleanacquire(java.util.UUID theTxId, long theTime, java.util.concurrent.TimeUnit theTimeUnit)Tries to acquire a lock for a transaction.booleanisAcquired(java.util.UUID theTxId)booleanisAcquiredByAny()voidrelease(java.util.UUID theTxId)Release a lock for a transaction.voidreleaseAll()Release all locks for transactions that have been acquired.
-
-
-
Method Detail
-
acquire
void acquire(java.util.UUID theTxId) throws java.lang.ExceptionTries 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:
java.lang.Exception
-
acquire
boolean acquire(java.util.UUID theTxId, long theTime, java.util.concurrent.TimeUnit theTimeUnit) throws java.lang.ExceptionTries 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:
java.lang.Exception
-
release
void release(java.util.UUID theTxId) throws java.lang.ExceptionRelease a lock for a transaction.- Parameters:
theTxId-- Throws:
java.lang.Exception
-
isAcquiredByAny
boolean isAcquiredByAny() throws java.io.IOException- Returns:
- true if any locks of this type are acquired by any thread/process.
- Throws:
java.io.IOException
-
isAcquired
boolean isAcquired(java.util.UUID theTxId) throws java.io.IOException- Returns:
- true if a lock for the specific transaction is acquired by any thread/process.
- Throws:
java.io.IOException
-
releaseAll
void releaseAll() throws java.lang.ExceptionRelease all locks for transactions that have been acquired.- Throws:
java.lang.Exception
-
-