01: // Copyright (c) 2004-2005 Sun Microsystems Inc., All Rights Reserved.
02:
03: /*
04: * ServicelistState.java
05: *
06: * SUN PROPRIETARY/CONFIDENTIAL
07: * This software is the proprietary information of Sun Microsystems, Inc.
08: * Use is subject to license term
09: */
10: package com.sun.jbi.engine.sequencing.servicelist;
11:
12: /**
13: * This class maintains permitted servicelist states.
14: *
15: * @author Sun Microsystems, Inc.
16: */
17: public final class ServicelistState {
18: /**
19: * Demotes the list is ready.
20: */
21: public static final int READY = 0;
22:
23: /**
24: * Demotes the list is runnning.
25: */
26: public static final int RUNNING = 1;
27:
28: /**
29: * Waiting.
30: */
31: public static final int WAITING = 2;
32:
33: /**
34: * Timed out state.
35: */
36: public static final int TIMED_OUT = 3;
37:
38: /**
39: * Aborted.
40: */
41: public static final int ABORTED = 4;
42:
43: /**
44: * Completed.
45: */
46: public static final int COMPLETED = 5;
47:
48: /**
49: * Error state.
50: */
51: public static final int ERROR = 6;
52:
53: /**
54: * Returns the string representation of the state.
55: *
56: * @param state state
57: *
58: * @return String rep of state.
59: */
60: public static String getStringValue(int state) {
61: switch (state) {
62: case READY:
63: return "READY";
64:
65: case RUNNING:
66: return "RUNNING";
67:
68: case WAITING:
69: return "WAITING";
70:
71: case TIMED_OUT:
72: return "TIMED OUT";
73:
74: case ABORTED:
75: return "ABORTED";
76:
77: case COMPLETED:
78: return "COMPLETED";
79:
80: case ERROR:
81: return "ERROR";
82:
83: default:
84: return "INVALID STATE";
85: }
86: }
87: }
|