Source Code Cross Referenced for SysInfo.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » common » classes » 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.common.classes 
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 at $PEGASUS_HOME/GTPL or
004:         * http://www.globus.org/toolkit/download/license.html.
005:         * This notice must appear in redistributions of this file
006:         * with or without modification.
007:         *
008:         * Redistributions of this Software, with or without modification, must reproduce
009:         * the GTPL in:
010:         * (1) the Software, or
011:         * (2) the Documentation or
012:         * some other similar material which is provided with the Software (if any).
013:         *
014:         * Copyright 1999-2004
015:         * University of Chicago and The University of Southern California.
016:         * All rights reserved.
017:         */package org.griphyn.common.classes;
018:
019:        /**
020:         * This class keeps the system information associated with a
021:         * resource or transformation.
022:         *
023:         * @author Gaurang Mehta gmehta@isi.edu
024:         * @version $Revision: 316 $
025:         */
026:
027:        public class SysInfo {
028:
029:            /**
030:             * Architecture of the system.
031:             */
032:            private Arch arch;
033:
034:            /**
035:             * Os of the system.
036:             */
037:            private Os os;
038:
039:            /**
040:             * Os version of the system.
041:             */
042:            private String osversion;
043:
044:            /**
045:             * Glibc version of the system
046:             */
047:            private String glibc;
048:
049:            /**
050:             * The secondary convenience constructor.
051:             * @param arch Arch  The architecture of the system.
052:             * @param os Os The os of the system.
053:             * @param osversion String  The os version of the system.
054:             * @param glibc String The glibc version of the system.
055:             * @see Arch
056:             * @see Os
057:             */
058:            public SysInfo(Arch arch, Os os, String osversion, String glibc) {
059:                this .arch = (arch == null) ? Arch.INTEL32 : arch;
060:                this .os = (os == null) ? Os.LINUX : os;
061:
062:                this .osversion = (osversion == null || osversion.equals("")) ? null
063:                        : osversion;
064:
065:                this .glibc = (glibc == null || glibc.equals("")) ? null : glibc;
066:            }
067:
068:            /**
069:             * Another convenience constructor that uses all entries as strings.
070:             * @param arch String
071:             * @param os String
072:             * @param glibc String
073:             */
074:            public SysInfo(String arch, String os, String glibc) {
075:                this (arch, os, null, glibc);
076:            }
077:
078:            /**
079:             * Another convenience constructor that uses all entries as strings.
080:             * @param arch String
081:             * @param os String
082:             * @param osversion String
083:             * @param glibc String
084:             */
085:            public SysInfo(String arch, String os, String osversion,
086:                    String glibc) {
087:                this .arch = (arch == null) ? Arch.INTEL32 : Arch
088:                        .fromString(arch);
089:                this .os = (os == null) ? Os.LINUX : Os.fromString(os);
090:                this .osversion = (osversion == null || osversion.equals("")) ? null
091:                        : osversion;
092:
093:                this .glibc = (glibc == null || glibc.equals("")) ? null : glibc;
094:            }
095:
096:            public SysInfo(String system) {
097:                if (system != null) {
098:                    String s1[] = system.split("::", 2);
099:                    if (s1.length == 2) {
100:                        arch = Arch.fromString(s1[0]);
101:                        String s2[] = s1[1].split(":", 3);
102:                        os = Os.fromString(s2[0]);
103:                        for (int i = 1; i < s2.length; i++) {
104:                            if (i == 1) {
105:                                osversion = s2[i];
106:                            }
107:                            if (i == 2) {
108:                                glibc = s2[i];
109:                            }
110:                        }
111:                    } else {
112:                        throw new IllegalStateException(
113:                                "Error : Please check your system info string");
114:                    }
115:                } else {
116:                    this .arch = Arch.INTEL32;
117:                    this .os = Os.LINUX;
118:                }
119:            }
120:
121:            /**
122:             * The default constructor.
123:             * Sets the sysinfo to INTEL32::LINUX
124:             */
125:            public SysInfo() {
126:                this .arch = Arch.INTEL32;
127:                this .os = Os.LINUX;
128:            }
129:
130:            /**
131:             * Sets the architecture of the system.
132:             * @param arch Arch
133:             * @see Arch
134:             */
135:            public void setArch(Arch arch) {
136:                this .arch = (arch == null) ? Arch.INTEL32 : arch;
137:            }
138:
139:            /**
140:             * Sets the Os of the sytem.
141:             * @param os Os
142:             * @see Os
143:             */
144:            public void setOs(Os os) {
145:                this .os = (os == null) ? Os.LINUX : os;
146:            }
147:
148:            /**
149:             * Sets the Os version of the system.
150:             * @param osversion String
151:             */
152:            public void setOsversion(String osversion) {
153:                this .osversion = osversion;
154:            }
155:
156:            /**
157:             * Sets the glibc version of the system
158:             * @param glibc String
159:             */
160:            public void setGlibc(String glibc) {
161:                this .glibc = glibc;
162:            }
163:
164:            /**
165:             * Returns the architecture of the sytem.
166:             * @return Arch
167:             * @see Arch
168:             */
169:            public Arch getArch() {
170:                return arch;
171:            }
172:
173:            /**
174:             * Returns the os type of the system.
175:             * @return Os
176:             * @see Os
177:             */
178:            public Os getOs() {
179:                return os;
180:            }
181:
182:            /**
183:             * Returns the os version of the system.
184:             * @return String
185:             */
186:            public String getOsversion() {
187:                return osversion;
188:            }
189:
190:            /**
191:             * Retuns the glibc version of the system.
192:             * @return String
193:             */
194:            public String getGlibc() {
195:                return glibc;
196:            }
197:
198:            /**
199:             * Return a copy of this Sysinfo object
200:             * @return Object
201:             */
202:            public Object clone() {
203:                return new SysInfo(arch, os, osversion, glibc);
204:            }
205:
206:            /**
207:             * Check if the system information matches.
208:             * @param obj to be compared.
209:             * @return boolean
210:             */
211:            public boolean equals(Object obj) {
212:                boolean result = false;
213:                if (obj instanceof  SysInfo) {
214:                    SysInfo sysinfo = (SysInfo) obj;
215:                    result = (arch.equals(sysinfo.getArch()) && os
216:                            .equals(sysinfo.getOs()));
217:                }
218:                return result;
219:            }
220:
221:            /**
222:             * Returns the output of the data class as string.
223:             * @return String
224:             */
225:            public String toString() {
226:                StringBuffer s = new StringBuffer();
227:                s.append(arch + "::" + os);
228:                if (osversion != null) {
229:                    s.append(":" + osversion);
230:                }
231:                if (glibc != null) {
232:                    s.append(":" + glibc);
233:                }
234:                return s.toString();
235:            }
236:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.