Source Code Cross Referenced for FlowExecutionListeners.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » engine » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » spring webflow 1.0.4 » org.springframework.webflow.engine.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004-2007 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.springframework.webflow.engine.impl;
017:
018:        import org.springframework.webflow.core.collection.AttributeMap;
019:        import org.springframework.webflow.core.collection.MutableAttributeMap;
020:        import org.springframework.webflow.definition.FlowDefinition;
021:        import org.springframework.webflow.definition.StateDefinition;
022:        import org.springframework.webflow.execution.Event;
023:        import org.springframework.webflow.execution.FlowExecutionException;
024:        import org.springframework.webflow.execution.FlowExecutionListener;
025:        import org.springframework.webflow.execution.FlowSession;
026:        import org.springframework.webflow.execution.RequestContext;
027:        import org.springframework.webflow.execution.ViewSelection;
028:
029:        /**
030:         * A helper that aids in publishing events to an array of
031:         * <code>FlowExecutionListener</code> objects.
032:         * 
033:         * @see org.springframework.webflow.execution.FlowExecutionListener
034:         * 
035:         * @author Keith Donald
036:         * @author Erwin Vervaet
037:         */
038:        class FlowExecutionListeners {
039:
040:            /**
041:             * The list of listeners that should receive event callbacks during managed
042:             * flow executions.
043:             */
044:            private FlowExecutionListener[] listeners;
045:
046:            /**
047:             * Create a flow execution listener helper that wraps an empty listener
048:             * array.
049:             */
050:            public FlowExecutionListeners() {
051:                this (null);
052:            }
053:
054:            /**
055:             * Create a flow execution listener helper that wraps the specified listener
056:             * array.
057:             * @param listeners the listener array
058:             */
059:            public FlowExecutionListeners(FlowExecutionListener[] listeners) {
060:                if (listeners != null) {
061:                    this .listeners = listeners;
062:                } else {
063:                    this .listeners = new FlowExecutionListener[0];
064:                }
065:            }
066:
067:            /**
068:             * Returns the wrapped listener array.
069:             * @return the listener array
070:             */
071:            public FlowExecutionListener[] getArray() {
072:                return listeners;
073:            }
074:
075:            /**
076:             * Returns the size of the listener array.
077:             */
078:            public int size() {
079:                return listeners.length;
080:            }
081:
082:            // methods to fire events to all listeners
083:
084:            /**
085:             * Notify all interested listeners that a request was submitted to the flow
086:             * execution.
087:             */
088:            public void fireRequestSubmitted(RequestContext context) {
089:                for (int i = 0; i < listeners.length; i++) {
090:                    listeners[i].requestSubmitted(context);
091:                }
092:            }
093:
094:            /**
095:             * Notify all interested listeners that the flow execution finished
096:             * processing a request.
097:             */
098:            public void fireRequestProcessed(RequestContext context) {
099:                for (int i = 0; i < listeners.length; i++) {
100:                    listeners[i].requestProcessed(context);
101:                }
102:            }
103:
104:            /**
105:             * Notify all interested listeners that a flow execution session is starting
106:             * (about to be created).
107:             */
108:            public void fireSessionStarting(RequestContext context,
109:                    FlowDefinition flow, MutableAttributeMap input) {
110:                for (int i = 0; i < listeners.length; i++) {
111:                    listeners[i].sessionStarting(context, flow, input);
112:                }
113:            }
114:
115:            /**
116:             * Notify all interested listeners that a flow execution session has been
117:             * activated (created, on the stack and about to start).
118:             */
119:            public void fireSessionCreated(RequestContext context,
120:                    FlowSession session) {
121:                for (int i = 0; i < listeners.length; i++) {
122:                    listeners[i].sessionCreated(context, session);
123:                }
124:            }
125:
126:            /**
127:             * Notify all interested listeners that a flow execution session has
128:             * started (has entered its start state).
129:             */
130:            public void fireSessionStarted(RequestContext context,
131:                    FlowSession session) {
132:                for (int i = 0; i < listeners.length; i++) {
133:                    listeners[i].sessionStarted(context, session);
134:                }
135:            }
136:
137:            /**
138:             * Notify all interested listeners that an event was signaled in the flow
139:             * execution.
140:             */
141:            public void fireEventSignaled(RequestContext context, Event event) {
142:                for (int i = 0; i < listeners.length; i++) {
143:                    listeners[i].eventSignaled(context, event);
144:                }
145:            }
146:
147:            /**
148:             * Notify all interested listeners that a state is being entered in the flow
149:             * execution.
150:             */
151:            public void fireStateEntering(RequestContext context,
152:                    StateDefinition nextState) {
153:                for (int i = 0; i < listeners.length; i++) {
154:                    listeners[i].stateEntering(context, nextState);
155:                }
156:            }
157:
158:            /**
159:             * Notify all interested listeners that a state was entered in the flow
160:             * execution.
161:             */
162:            public void fireStateEntered(RequestContext context,
163:                    StateDefinition previousState) {
164:                for (int i = 0; i < listeners.length; i++) {
165:                    listeners[i].stateEntered(context, previousState, context
166:                            .getCurrentState());
167:                }
168:            }
169:
170:            /**
171:             * Notify all interested listeners that a flow session was paused in the
172:             * flow execution.
173:             */
174:            public void firePaused(RequestContext context,
175:                    ViewSelection selectedView) {
176:                for (int i = 0; i < listeners.length; i++) {
177:                    listeners[i].paused(context, selectedView);
178:                }
179:            }
180:
181:            /**
182:             * Notify all interested listeners that the flow execution was resumed.
183:             */
184:            public void fireResumed(RequestContext context) {
185:                for (int i = 0; i < listeners.length; i++) {
186:                    listeners[i].resumed(context);
187:                }
188:            }
189:
190:            /**
191:             * Notify all interested listeners that the active flow execution session is
192:             * ending.
193:             */
194:            public void fireSessionEnding(RequestContext context,
195:                    FlowSession session, MutableAttributeMap output) {
196:                for (int i = 0; i < listeners.length; i++) {
197:                    listeners[i].sessionEnding(context, session, output);
198:                }
199:            }
200:
201:            /**
202:             * Notify all interested listeners that a flow execution session has ended.
203:             */
204:            public void fireSessionEnded(RequestContext context,
205:                    FlowSession session, AttributeMap output) {
206:                for (int i = 0; i < listeners.length; i++) {
207:                    listeners[i].sessionEnded(context, session, output);
208:                }
209:            }
210:
211:            /**
212:             * Notify all interested listeners that a flow execution threw an exception.
213:             */
214:            public void fireExceptionThrown(RequestContext context,
215:                    FlowExecutionException exception) {
216:                for (int i = 0; i < listeners.length; i++) {
217:                    listeners[i].exceptionThrown(context, exception);
218:                }
219:            }
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.