KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > actionflow > config > Node


1 /*
2  * Copyright (c) 2002, Inversoft Corporation, All Rights Reserved
3  */

4 package com.inversoft.verge.mvc.controller.actionflow.config;
5
6
7 import com.inversoft.verge.mvc.controller.actionflow.NodeExecutor;
8
9
10 /**
11  * <p>
12  * This interface is the base for all Node configurations. This
13  * should be implemented or sub-classed to provide new types
14  * of Nodes and thereby creating new Config objects for those
15  * types of Nodes.
16  * </p>
17  *
18  * <p>
19  * This interface contains most of the relevant base information
20  * which is used by the AstionFlow system itself. This basically
21  * means that in order for the ActionFlow system to function
22  * properly, everything in this interface must be implemented
23  * correctly.
24  * </p>
25  *
26  * @author Brian Pontarelli
27  * @since 2.0
28  * @version 2.0
29  */

30 public interface Node {
31
32     /**
33      * Returns the name of the Node
34      *
35      * @return The name of the Node
36      */

37     String JavaDoc getName();
38
39     /**
40      * Returns the type of the Node
41      *
42      * @return The type of the Node
43      */

44     String JavaDoc getType();
45
46     /**
47      * Returns the namespace that this Node is a part of
48      *
49      * @return The namespace of this Node
50      */

51     Namespace getNamespace();
52
53     /**
54      * <p>
55      * Returns the name of the class of this Node. This is the name of the class
56      * that this Node describes. This is also the class that the
57      * ActionFlow system may instantiate during execution and will be called.
58      * </p>
59      *
60      * <p>
61      * This is an optional value for the configuration. The reason for this is
62      * that the construction and execution of the Nodes is extensible and
63      * therefore the implementation may not need to use the class name or the
64      * repository id in order to locate or instantiate the Node.
65      * </p>
66      *
67      * @return The class name of the Node or null if it is not specified
68      */

69     String JavaDoc getClassName();
70
71     /**
72      * <p>
73      * Returns the repository id of this Node. This repository id may be used by
74      * the ActionFlow system to locate the Node during execution.
75      * </p>
76      *
77      * <p>
78      * This is an optional value for the configuration. The reason for this is
79      * that the construction and execution of the Nodes is extensible and
80      * therefore the implementation may not need to use the class name or the
81      * repository id in order to locate or instantiate the Node.
82      * </p>
83      *
84      * @return The repository id of the Node or null if it is not specified
85      */

86     String JavaDoc getRepositoryId();
87
88     /**
89      * Returns whether or not the Node described by this Node is the default
90      * entry Node for the ActionFlow namespace it is defined it. There can only be
91      * one default entry Node per namespace.
92      *
93      * @return True if this Node is the default entry Node, false otherwise
94      */

95     boolean isDefaultEntry();
96
97     /**
98      * <p>
99      * Returns whether or not the Node described by this Node can accept
100      * the given entry point name. This is used by the ActionFlow system to
101      * locate the entry point. If the entry point can not be found by name,
102      * then all entry point Nodes are queried to determine if they can
103      * accept the given name.
104      * </p>
105      *
106      * <p>
107      * It is important to realize if two Nodes can both accept the same
108      * name, it is really a toss up as to which Node will be called. Therefore
109      * the developer should be very careful about their configuration.
110      * </p>
111      *
112      * @param name The name to check for entry node acceptance
113      * @return True if this Node accepts the given name and will be the entry
114      * point
115      */

116     boolean acceptEntry(String JavaDoc name);
117
118     /**
119      * Returns whether or not the Node described by this Node is an exit
120      * Node. Exit Nodes are always executed, but execution stops after they
121      * complete. If this flag is set, the {@link
122      * com.inversoft.verge.mvc.controller.actionflow.ActionFlowExecutor
123      * ActionFlowExecutor} will not execute anything after the Node is finished
124      * executing.
125      *
126      * @return True if this Node is an exit point, false otherwise
127      */

128     boolean isExitPoint();
129
130     /**
131      * Returns the complete list of links for the Node described by this Node
132      *
133      * @return The list of links
134      */

135     Link [] getLinks();
136
137     /**
138      * Returns the Link for the Node described by this Node that accepts
139      * the given action. Implementations can do this lookup however they see fit.
140      * This is very important distiction because it allows implementations to support
141      * wildcards, regular expressions and any other type of links they might need.
142      * The parameter is an Object so that individual Nodes can accept any Object
143      * that is returned from any other Node. The executor also could pass in
144      * Exception objects to locate Links.
145      *
146      * @param action The Object that was result from another Node or an Object
147      * instance from the ActionFlowExecutor such as an Exception
148      * @return The Link that accepts the given action or null
149      */

150     Link findLink(Object JavaDoc action);
151
152     /**
153      * Adds the given Link to the the Node described by this Node.
154      * This can be used at runtime to change or augment the behavior of the
155      * ActionFlow system. If there is already an ActionLink stored in this Node
156      * with the same action, it is replaced and returned.
157      *
158      * @param link The Link to add
159      * @return The old Link for the action, or null
160      */

161     //Link addLink(Link link);
162

163     /**
164      * Returns the NodeExecutor used to execute the Node described by this
165      * Node
166      *
167      * @return The NodeExecutor for this Node
168      */

169     NodeExecutor getExecutor();
170
171     /**
172      * Sets the executor used to execute the Node described by this Node
173      *
174      * @param executor The NodeExecutor for this Node
175      */

176     //void setExecutor(NodeExecutor executor);
177

178     /**
179      * Returns whether or not long transaction support is enabled for the given
180      * Node or not. This is a configurable property of every type of Node allowing
181      * any node to be enabled for long transactions.
182      *
183      * @return True if the node is enabled for long transactions, false otherwise
184      */

185     boolean isLongTxnEnabled();
186
187     /**
188      * Returns the URL that is displayed to the user when a long transaction is
189      * started. This URL must be local and includable dynamically on the server
190      * side.
191      *
192      * @return The long transaction start URL or null
193      */

194     String JavaDoc getLongTxnStartURL();
195
196     /**
197      * Returns the URL that is rendered in order to redirect the user out of a
198      * long transaction in order to end the long transaction. This URL must be
199      * local and includable dynamically on the server side.
200      *
201      * @return The long transaction end URL or null
202      */

203     String JavaDoc getLongTxnEndURL();
204
205     /**
206      * Returns the category that is available to the long transaction end URL in
207      * order to handle production deployments. This must be a valid category for
208      * use by the {@link com.inversoft.verge.util.url.URLGenerator URLGenerator}.
209      *
210      * @return The long transaction category or null
211      */

212     String JavaDoc getLongTxnCategory();
213 }
Popular Tags