public class AbstractActionInterceptor extends Object implements ActionInterceptor
SUFFIX
Constructor and Description |
---|
AbstractActionInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected AbortActionExecution |
abortActionExecution() |
void |
after(ActionExecutionStatus status,
GriffonController controller,
String actionName,
Object[] args)
Called after the action has been aborted or executed, even if an exception
occurred during execution.
|
Object[] |
before(GriffonController controller,
String actionName,
Object[] args)
Called before an action is executed.
|
void |
configure(GriffonController controller,
String actionName,
Method method)
Inspect the action during the configuration phase.
|
boolean |
exception(Exception exception,
GriffonController controller,
String actionName,
Object[] args)
Called after the action has been executed when an exception occurred
during execution.
|
protected String |
qualifyActionName(GriffonController controller,
String actionName) |
public void configure(@Nonnull GriffonController controller, @Nonnull String actionName, @Nonnull Method method)
ActionInterceptor
before()
, after()
and exception()
.configure
in interface ActionInterceptor
controller
- the controller that owns the actionactionName
- the action's namemethod
- the method that represents the action itself@Nonnull public Object[] before(@Nonnull GriffonController controller, @Nonnull String actionName, @Nonnull Object[] args)
ActionInterceptor
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.before
in interface ActionInterceptor
controller
- the controller that owns the actionactionName
- the action's nameargs
- the action's argumentspublic void after(@Nonnull ActionExecutionStatus status, @Nonnull GriffonController controller, @Nonnull String actionName, @Nonnull Object[] args)
ActionInterceptor
after
in interface ActionInterceptor
status
- a flag that indicates the execution status of the actioncontroller
- the controller that owns the actionactionName
- the action's nameargs
- the arguments sent to the actionpublic boolean exception(@Nonnull Exception exception, @Nonnull GriffonController controller, @Nonnull String actionName, @Nonnull Object[] args)
ActionInterceptor
exception
in interface ActionInterceptor
exception
- the exception thrown during the action's executioncontroller
- the controller that owns the actionactionName
- the action's nameargs
- the arguments sent to the action during executiontrue
if the exception was handled successfully,
false
otherwise.@Nonnull protected AbortActionExecution abortActionExecution() throws AbortActionExecution
AbortActionExecution