public abstract class BaseLockingAction extends Object implements Action
Action
implementation for locking.
This contains the basic steps for lock acquition: try to acquire, check when it is available and acquired (or not).Modifier and Type | Class and Description |
---|---|
protected static class |
BaseLockingAction.InternalState |
Constructor and Description |
---|
BaseLockingAction(ClusteringDependentLogic clusteringDependentLogic) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
cas(BaseLockingAction.InternalState expectedState,
BaseLockingAction.InternalState newState) |
ActionStatus |
check(ActionState state)
It checks this action.
|
protected abstract ActionStatus |
checking(ActionState state) |
void |
cleanup(ActionState state)
Cleanups when it is no longer needed.
|
protected List<Object> |
getAndUpdateFilteredKeys(ActionState state) |
protected abstract ActionStatus |
init(ActionState state) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener
public BaseLockingAction(ClusteringDependentLogic clusteringDependentLogic)
public final ActionStatus check(ActionState state)
Action
ActionStatus.READY
or ActionStatus.CANCELED
are final states.
This method should be thread safe and idempotent since it can be invoked multiple times by multiples threads.protected abstract ActionStatus checking(ActionState state)
protected abstract ActionStatus init(ActionState state)
protected final boolean cas(BaseLockingAction.InternalState expectedState, BaseLockingAction.InternalState newState)
protected final List<Object> getAndUpdateFilteredKeys(ActionState state)
public void cleanup(ActionState state)
Action
Copyright © 2023 JBoss, a division of Red Hat. All rights reserved.