public class DefaultPendingLockManager extends Object implements PendingLockManager
PendingLockManager
.
In transactional caches, a transaction would wait for transaction originated in a older topology id. It can happen when topology changes and a backup owner becomes the primary owner.
Constructor and Description |
---|
DefaultPendingLockManager() |
public PendingLockPromise checkPendingTransactionsForKey(TxInvocationContext<?> ctx, Object key, long time, TimeUnit unit)
PendingLockManager
PendingLockManager.awaitPendingTransactionsForKey(TxInvocationContext, Object, long, TimeUnit)
but non-blocking.
Multiple invocations with the same transaction returns the same PendingLockPromise
. For cleanup purposes,
PendingLockManager.awaitPendingTransactionsForKey(TxInvocationContext, Object, long, TimeUnit)
must be invoked
afterwards.
checkPendingTransactionsForKey
in interface PendingLockManager
ctx
- the TxInvocationContext
.key
- the key to check.time
- timeout.unit
- TimeUnit
of time
.PendingLockPromise
.public PendingLockPromise checkPendingTransactionsForKeys(TxInvocationContext<?> ctx, Collection<Object> keys, long time, TimeUnit unit)
PendingLockManager
PendingLockManager.awaitPendingTransactionsForAllKeys(TxInvocationContext, Collection, long, TimeUnit)
but
non-blocking.
Multiple invocations with the same transaction returns the same PendingLockPromise
. For cleanup purposes,
PendingLockManager.awaitPendingTransactionsForAllKeys(TxInvocationContext, Collection, long, TimeUnit)
must be invoked
afterwards.
checkPendingTransactionsForKeys
in interface PendingLockManager
ctx
- the TxInvocationContext
.keys
- the keys to check.time
- timeout.unit
- TimeUnit
of time
.PendingLockPromise
.public long awaitPendingTransactionsForKey(TxInvocationContext<?> ctx, Object key, long time, TimeUnit unit) throws InterruptedException
PendingLockManager
key
acquired.awaitPendingTransactionsForKey
in interface PendingLockManager
ctx
- the TxInvocationContext
.key
- the key to check.time
- timeout.unit
- TimeUnit
of time
.InterruptedException
- if the thread is interrupted while waiting.public long awaitPendingTransactionsForAllKeys(TxInvocationContext<?> ctx, Collection<Object> keys, long time, TimeUnit unit) throws InterruptedException
PendingLockManager
keys
acquired.awaitPendingTransactionsForAllKeys
in interface PendingLockManager
ctx
- the TxInvocationContext
.keys
- the keys to check.time
- timeout.unit
- TimeUnit
of time
.InterruptedException
- if the thread is interrupted while waiting.Copyright © 2021 JBoss by Red Hat. All rights reserved.