Source Code Cross Referenced for Status.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » invocation » 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 » pegasus 2.1.0 » org.griphyn.vdl.invocation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:        package org.griphyn.vdl.invocation;
016:
017:        import java.util.*;
018:        import java.io.Writer;
019:        import java.io.IOException;
020:
021:        /**
022:         * This class encapsulates the exit code or reason of termination for
023:         * a given job. The class itself contains the raw exit code. It also
024:         * aggregates an instance of the JobStatus interface, which describes
025:         * more clearly failure, regular execution, signal and suspension. 
026:         *
027:         * @author Jens-S. Vöckler
028:         * @author Yong Zhao
029:         * @version $Revision: 50 $
030:         */
031:        public class Status extends Invocation // implements Cloneable
032:        {
033:            /**
034:             * The raw exit code, unparsed and unprepared. There are several
035:             * interpretation of the value. Usually, it is interpreted as
036:             * unsigned 16 bit value. The high byte contains the exit code.
037:             * The low byte has the core dump flag as MSB, and the rest denote
038:             * the signal number. A value of -1 denotes a failure from the
039:             * grid launcher before starting the job. 
040:             */
041:            private int m_status;
042:
043:            /**
044:             * This member variable contains the real status of the job.
045:             */
046:            private JobStatus m_jobStatus;
047:
048:            /**
049:             * Default c'tor: Construct a hollow shell and allow further
050:             * information to be added later.
051:             */
052:            public Status() {
053:                m_status = 0;
054:                m_jobStatus = null;
055:            }
056:
057:            /**
058:             * Constructs a layer with the raw exit code.
059:             * @param raw is the raw exit code to store.
060:             */
061:            public Status(int raw) {
062:                m_status = raw;
063:                m_jobStatus = null;
064:            }
065:
066:            /**
067:             * Constructs the complete class with raw exit code
068:             * and a status child describing the exit code.
069:             * @param raw is the raw exit status
070:             * @param status is the description of the kind of exit.
071:             */
072:            public Status(int raw, JobStatus status) {
073:                m_status = raw;
074:                m_jobStatus = status;
075:            }
076:
077:            /**
078:             * Accessor
079:             *
080:             * @see #setStatus(int)
081:             */
082:            public int getStatus() {
083:                return this .m_status;
084:            }
085:
086:            /**
087:             * Accessor.
088:             *
089:             * @param status
090:             * @see #getStatus()
091:             */
092:            public void setStatus(int status) {
093:                this .m_status = status;
094:            }
095:
096:            /**
097:             * Accessor
098:             *
099:             * @see #setJobStatus( JobStatus )
100:             */
101:            public JobStatus getJobStatus() {
102:                return this .m_jobStatus;
103:            }
104:
105:            /**
106:             * Accessor.
107:             *
108:             * @param jobStatus is an instance of the class describing
109:             * the real reason for program termination on the remote end.
110:             * @see #getJobStatus()
111:             */
112:            public void setJobStatus(JobStatus jobStatus) {
113:                this .m_jobStatus = jobStatus;
114:            }
115:
116:            /**
117:             * Converts the active state into something meant for human consumption.
118:             * The method will be called when recursively traversing the instance
119:             * tree. 
120:             *
121:             * @param stream is a stream opened and ready for writing. This can also
122:             * be a string stream for efficient output.
123:             */
124:            public void toString(Writer stream) throws IOException {
125:                throw new IOException(
126:                        "method not implemented, please contact vds-support@griphyn.org");
127:            }
128:
129:            /**
130:             * Dump the state of the current element as XML output. This function
131:             * traverses all sibling classes as necessary, and converts the data
132:             * into pretty-printed XML output. The stream interface should be able
133:             * to handle large output efficiently.
134:             *
135:             * @param stream is a stream opened and ready for writing. This can also
136:             * be a string stream for efficient output.
137:             * @param indent is a <code>String</code> of spaces used for pretty
138:             * printing. The initial amount of spaces should be an empty string.
139:             * The parameter is used internally for the recursive traversal.
140:             * If a <code>null</code> value is specified, no indentation nor
141:             * linefeeds will be generated. 
142:             * @param namespace is the XML schema namespace prefix. If neither
143:             * empty nor null, each element will be prefixed with this prefix,
144:             * and the root element will map the XML namespace. 
145:             * @exception IOException if something fishy happens to the stream.
146:             */
147:            public void toXML(Writer stream, String indent, String namespace)
148:                    throws IOException {
149:                String tag = (namespace != null && namespace.length() > 0) ? namespace
150:                        + ":status"
151:                        : "status";
152:
153:                // open tag
154:                if (indent != null && indent.length() > 0)
155:                    stream.write(indent);
156:                stream.write('<');
157:                stream.write(tag);
158:                writeAttribute(stream, " raw=\"", Integer.toString(m_status));
159:                stream.write(">");
160:
161:                // dump content
162:                String newindent = indent == null ? null : indent + "  ";
163:                if (m_jobStatus != null)
164:                    m_jobStatus.toXML(stream, newindent, namespace);
165:                else
166:                    throw new RuntimeException("unknown state of job status");
167:
168:                // close tag
169:                stream.write("</");
170:                stream.write(tag);
171:                stream.write('>');
172:                if (indent != null)
173:                    stream.write(System.getProperty("line.separator", "\r\n"));
174:            }
175:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.