KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > actionflow > ActionFlowAction


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.controller.actionflow;
8
9
10 import java.util.Map JavaDoc;
11
12 import javax.servlet.http.HttpServletRequest JavaDoc;
13 import javax.servlet.http.HttpServletResponse JavaDoc;
14
15 import com.inversoft.verge.mvc.controller.Action;
16 import com.inversoft.verge.mvc.controller.actionflow.config.Node;
17 import com.inversoft.verge.util.RequestContext;
18
19
20 /**
21  * This class holds the action that was taken on the
22  * ActionFlow system and the currently executing node. This
23  * action and node changes as the ActionFlow system executes
24  * so that itreflects the current state of the execution.
25  *
26  * @author Brian Pontarelli
27  * @since 2.0
28  * @version 2.0
29  */

30 public class ActionFlowAction extends Action {
31
32     private Node node;
33     private Map JavaDoc extraParams;
34
35
36     /**
37      * Constructs a new <code>ActionFlowAction</code>.
38      */

39     public ActionFlowAction(Object JavaDoc action, HttpServletRequest JavaDoc request,
40             HttpServletResponse JavaDoc response, Node node, RequestContext requestContext) {
41         super(action, request, response, requestContext);
42         this.node = node;
43     }
44
45     /**
46      * Constructs a new <code>ActionFlowAction</code>.
47      */

48     public ActionFlowAction(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response,
49             RequestContext requestContext) {
50         super(null, request, response, requestContext);
51     }
52
53     /**
54      * Constructs a new <code>ActionFlowAction</code>.
55      */

56     public ActionFlowAction(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
57         super(null, request, response);
58     }
59
60
61     /**
62      * Gets the {@link com.inversoft.verge.mvc.controller.actionflow.config.Node Node}
63      * of the Node currently being executed
64      *
65      * @return The <code>Node</code> of the Node currently being executed
66      */

67     public Node getNode() {
68         return node;
69     }
70
71     /**
72      * Sets the {@link com.inversoft.verge.mvc.controller.actionflow.config.Node Node}
73      * of the Node currently being executed
74      *
75      * @param node The <code>Node</code> of the node currently being
76      * executed
77      */

78     void setNode(Node node) {
79         this.node = node;
80     }
81
82     /**
83      * Sets the current action
84      *
85      * @param action The current action
86      */

87     protected void setAction(Object JavaDoc action) {
88         super.setAction(action);
89     }
90
91     /**
92      * Returns whether or not the action is non-null and is an instanceof Throwable
93      *
94      * @return Whether or not the action is a Throwable
95      */

96     protected boolean isThrowable() {
97         Object JavaDoc action = getAction();
98         return (action != null & action instanceof Throwable JavaDoc);
99     }
100
101     /**
102      * Gets the extra parameter Map
103      *
104      * @return The extra parameter Map
105      */

106     public Map JavaDoc getExtraParams() {
107         return extraParams;
108     }
109
110     /**
111      * Sets the extra parameter Map
112      *
113      * @param extraParams The extra parameter Map
114      */

115     void setExtraParams(Map JavaDoc extraParams) {
116         this.extraParams = extraParams;
117     }
118 }
Popular Tags