Interface Action
-
- All Known Implementing Classes:
BaseLockingAction
,CheckTopologyAction
,LockAction
,PendingTxAction
,TriangleOrderAction
,TrianglePerCacheInboundInvocationHandler
public interface Action
An 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 void
addListener(ActionListener listener)
Adds a listener to be invoked when this action is ready or canceled.ActionStatus
check(ActionState state)
It checks this action.default void
onException(ActionState state)
Invoked when an exception occurs while processing the command.default void
onFinally(ActionState state)
Invoked always after the command is executed.
-
-
-
Method Detail
-
check
ActionStatus check(ActionState state)
It checks this action. WhenActionStatus.READY
orActionStatus.CANCELED
are 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
- theActionListener
to 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.\
-
-