1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.struts2.spi;
22
23 import java.lang.reflect.Method;
24
25 /***
26 * Context of an action execution.
27 *
28 * @author crazybob@google.com (Bob Lee)
29 */
30 public interface ActionContext {
31
32 /***
33 * Gets action instance.
34 */
35 Object getAction();
36
37 /***
38 * Gets action method.
39 */
40 Method getMethod();
41
42 /***
43 * Gets action name.
44 */
45 String getActionName();
46
47 /***
48 * Gets the path for the action's namespace.
49 */
50 String getNamespacePath();
51
52 /***
53 * Gets the {@link Result} instance for the action.
54 *
55 * @return {@link Result} instance or {@code null} if we don't have a result yet.
56 */
57 Result getResult();
58
59 /***
60 * Adds a result interceptor for the action. Enables executing code before and after a result, executing an
61 * alternate result, etc.
62 */
63 void addResultInterceptor(Result interceptor);
64
65 /***
66 * Gets context of action which chained to us.
67 *
68 * @return context of previous action or {@code null} if this is the first action in the chain
69 */
70 ActionContext getPrevious();
71
72 /***
73 * Gets context of action which this action chained to.
74 *
75 * @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
76 * action in the chain.
77 */
78 ActionContext getNext();
79 }