Interface Action
-
- All Known Implementing Classes:
BaseLockingAction,CheckTopologyAction,LockAction,PendingTxAction,TriangleOrderAction,TrianglePerCacheInboundInvocationHandler
public interface ActionAn action represents a step inPerCacheInboundInvocationHandler.- Since:
- 8.0
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddListener(ActionListener listener)Adds a listener to be invoked when this action is ready or canceled.ActionStatuscheck(ActionState state)It checks this action.default voidonException(ActionState state)Invoked when an exception occurs while processing the command.default voidonFinally(ActionState state)Invoked always after the command is executed.
-
-
-
Method Detail
-
check
ActionStatus check(ActionState state)
It checks this action. WhenActionStatus.READYorActionStatus.CANCELEDare final states. This method should be thread safe and idempotent since it can be invoked multiple times by multiples threads.- Parameters:
state- the current state.- Returns:
- the status of this action.
-
addListener
default void addListener(ActionListener listener)
Adds a listener to be invoked when this action is ready or canceled.- Parameters:
listener- theActionListenerto add.
-
onException
default void onException(ActionState state)
Invoked when an exception occurs while processing the command.- Parameters:
state- the current state.
-
onFinally
default void onFinally(ActionState state)
Invoked always after the command is executed.- Parameters:
state- the current state.\
-
-