01: package dalma;
02:
03: /**
04: * State of a {@link Conversation}.
05: *
06: * @author Kohsuke Kawaguchi
07: */
08: public final class ConversationState {
09: private final String value;
10:
11: public final boolean isRemovable;
12:
13: /**
14: * {@link Conversation} can be executed, and currently waiting for an available
15: * {@link Executor}.
16: */
17: public static final ConversationState RUNNABLE = new ConversationState(
18: "runnable", false);
19:
20: /**
21: * {@link Conversation} is being executed by an {@link Executor}.
22: */
23: public static final ConversationState RUNNING = new ConversationState(
24: "runnable", true);
25:
26: /**
27: * {@link Conversation} is waiting for an event. Its state is written to a disk
28: * to minimize the resource consumption.
29: */
30: public static final ConversationState SUSPENDED = new ConversationState(
31: "suspended", true);
32:
33: /**
34: * {@link Conversation} has finished its execution.
35: */
36: public static final ConversationState ENDED = new ConversationState(
37: "ended", false);
38:
39: private ConversationState(String value, boolean removable) {
40: this .value = value;
41: this .isRemovable = removable;
42: }
43:
44: public String toString() {
45: return value;
46: }
47: }
|