public interface PendingLockPromise
PendingLockManager
.
When a transaction need to wait for older topology transaction, this class allows it to check the state. If the
transaction does not need to wait, or all older transactions have finished or have timed out, the isReady()
method returns true
. Also, it allows the caller to add listeners to be notified when it is ready.
Modifier and Type | Field and Description |
---|---|
static PendingLockPromise |
NO_OP |
Modifier and Type | Method and Description |
---|---|
void |
addListener(PendingLockListener listener)
Adds a listener to this promise.
|
long |
getRemainingTimeout() |
boolean |
hasTimedOut() |
boolean |
isReady() |
InvocationStage |
toInvocationStage()
If successful,
getRemainingTimeout() will return the remaining timeout, in millis. |
static final PendingLockPromise NO_OP
boolean isReady()
true
when the transaction has finished the waiting.void addListener(PendingLockListener listener)
The listener must be non-null and it is invoked only once. If isReady()
returns true
, the listener
is immediately invoked in the invoker thread.
listener
- the PendingLockListener
to add.boolean hasTimedOut()
true
if the time out happened while waiting for older transactions.long getRemainingTimeout()
hasTimedOut()
is true
.InvocationStage toInvocationStage()
getRemainingTimeout()
will return the remaining timeout, in millis.
If timed out, the result InvocationStage
will be completed with a TimeoutException
.InvocationStage
for this lock.Copyright © 2021 JBoss by Red Hat. All rights reserved.