01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.execution;
17:
18: import org.springframework.core.enums.StaticLabeledEnum;
19:
20: /**
21: * Type-safe enumeration of possible flow session statuses. Consult the
22: * JavaDoc for the {@link FlowSession} for more information on how these
23: * statuses are used during the life cycle of a flow session.
24: *
25: * @see org.springframework.webflow.execution.FlowSession
26: *
27: * @author Keith Donald
28: * @author Erwin Vervaet
29: */
30: public class FlowSessionStatus extends StaticLabeledEnum {
31:
32: /**
33: * Initial status of a flow session; the session has been created but not
34: * yet activated.
35: */
36: public static final FlowSessionStatus CREATED = new FlowSessionStatus(
37: 0, "Created");
38:
39: /**
40: * A flow session with STARTING status is about to enter its start state.
41: */
42: public static final FlowSessionStatus STARTING = new FlowSessionStatus(
43: 1, "Starting");
44:
45: /**
46: * A flow session with ACTIVE status is currently executing.
47: */
48: public static final FlowSessionStatus ACTIVE = new FlowSessionStatus(
49: 2, "Active");
50:
51: /**
52: * A flow session with PAUSED status is currently waiting on the user to
53: * signal an event.
54: */
55: public static final FlowSessionStatus PAUSED = new FlowSessionStatus(
56: 3, "Paused");
57:
58: /**
59: * A flow session that is SUSPENDED is not actively executing a flow. It is
60: * waiting for subflow execution to complete before continuing.
61: */
62: public static final FlowSessionStatus SUSPENDED = new FlowSessionStatus(
63: 4, "Suspended");
64:
65: /**
66: * A flow session that has ENDED is no longer actively executing a flow.
67: * This is the final status of a flow session.
68: */
69: public static final FlowSessionStatus ENDED = new FlowSessionStatus(
70: 5, "Ended");
71:
72: /**
73: * Private constructor because this is a typesafe enum!
74: */
75: private FlowSessionStatus(int code, String label) {
76: super(code, label);
77: }
78: }
|