Interface Action
- All Known Implementing Classes:
TriangleOrderAction
public interface Action
An action represents a step in
PerCacheInboundInvocationHandler.- Since:
- 8.0
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddListener(ActionListener listener) Adds a listener to be invoked when this action is ready or canceled.check(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 Details
-
check
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
Adds a listener to be invoked when this action is ready or canceled.- Parameters:
listener- theActionListenerto add.
-
onException
Invoked when an exception occurs while processing the command.- Parameters:
state- the current state.
-
onFinally
Invoked always after the command is executed.- Parameters:
state- the current state.\
-