public interface ActionHandler
Modifier and Type | Method and Description |
---|---|
void |
after(ActionExecutionStatus status,
Action action,
Object[] args)
Called after the action has been aborted or executed, even if an exception
occurred during execution.
|
Object[] |
before(Action action,
Object[] args)
Called before an action is executed.
|
void |
configure(Action action,
Method method)
Inspect the action during the configuration phase.
|
boolean |
exception(Exception exception,
Action action,
Object[] args)
Called after the action has been executed when an exception occurred
during execution.
|
void |
update(Action action)
Update the action's properties.
|
static final String SUFFIX
void update(@Nonnull Action action)
action
- the action to be updatedvoid configure(@Nonnull Action action, @Nonnull Method method)
This is the perfect time to search for annotations or any other information
required by the action. handlers have the option to cache such inspections
and recall them during before()
, after()
and exception()
.
action
- the action to be configuredmethod
- the method that represents the action itself@Nonnull Object[] before(@Nonnull Action action, @Nonnull Object[] args)
Implementors have the choice of throwing an AbortActionExecution
in
order to signal that the action should not be invoked. In any case this method
returns the arguments to be sent to the action, thus allowing the interceptor
to modify the arguments as it deem necessary. Failure to return an appropriate
value will most likely cause an error during the action's execution.
action
- the action to executeargs
- the action's argumentsAbortActionExecution
- if action execution should be aborted.void after(@Nonnull ActionExecutionStatus status, @Nonnull Action action, @Nonnull Object[] args)
status
- a flag that indicates the execution status of the actionaction
- the action to executeargs
- the arguments sent to the actionboolean exception(@Nonnull Exception exception, @Nonnull Action action, @Nonnull Object[] args)
The exception will be rethrown by the ActionManager if is not handled by any interceptor.
exception
- the exception thrown during the action's executionaction
- the action to executeargs
- the arguments sent to the action during executiontrue
if the exception was handled successfully,
false
otherwise.