KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > executor > FlowExecutor


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.springframework.webflow.executor;
17
18 import org.springframework.webflow.context.ExternalContext;
19 import org.springframework.webflow.core.FlowException;
20
21 /**
22  * The central facade and entry-point service interface into the Spring Web Flow
23  * system for <i>driving the executions of flow definitions</i>. This interface
24  * defines a coarse-grained system boundary suitable for invocation by most
25  * clients.
26  * <p>
27  * Implementations of this interface abstract away much of the internal
28  * complexity of the web flow execution subsystem, which consists of launching
29  * and resuming managed flow executions from repositories.
30  *
31  * @author Keith Donald
32  */

33 public interface FlowExecutor {
34
35     /**
36      * Launch a new execution of identified flow definition in the context of
37      * the current external client request.
38      * @param flowDefinitionId the unique id of the flow definition to launch
39      * @param context the external context representing the state of a request
40      * into Spring Web Flow from an external system
41      * @return the starting response instruction
42      * @throws FlowException if an exception occured launching the new flow
43      * execution
44      */

45     public ResponseInstruction launch(String JavaDoc flowDefinitionId, ExternalContext context) throws FlowException;
46
47     /**
48      * Resume an existing, paused flow execution by signaling an event against
49      * its current state.
50      * @param flowExecutionKey the identifying key of a paused flow execution
51      * that is waiting to resume on the occurrence of a user event
52      * @param eventId the user event that occured
53      * @param context the external context representing the state of a request
54      * into Spring Web Flow from an external system
55      * @return the next response instruction
56      * @throws FlowException if an exception occured resuming the existing flow
57      * execution
58      */

59     public ResponseInstruction resume(String JavaDoc flowExecutionKey, String JavaDoc eventId, ExternalContext context)
60             throws FlowException;
61
62     /**
63      * Reissue the last response instruction issued by the flow execution. This is
64      * a logical refresh operation that allows the "current response" to be
65      * re-issued. This operation is idempotent and does not affect the state of the flow
66      * execution.
67      * @param flowExecutionKey the identifying key of a paused flow execution
68      * that is waiting to resume on the ocurrence of a user event
69      * @param context the external context representing the state of a request
70      * into Spring Web Flow from an external system
71      * @return the current response instruction
72      * @throws FlowException if an exception occured retrieving the current
73      * response instruction
74      */

75     public ResponseInstruction refresh(String JavaDoc flowExecutionKey, ExternalContext context) throws FlowException;
76 }
Popular Tags