Source Code Cross Referenced for Version.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » common » util » 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.util 
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:
016:        package org.griphyn.common.util;
017:
018:        import java.io.*;
019:
020:        /* DO NOT EDIT! This file is generated automatically */
021:
022:        /**
023:         * This class solely defines the version numbers of PEGASUS. The template
024:         * file will be substituted by ant during the built process to compile
025:         * in the built timestamp.<p>
026:         *
027:         * When using the class, the methods for the version number digits
028:         * will always return an integer. In order to obtain the full version
029:         * number, including any "release candidate" suffices, please prefer
030:         * the <code>toString</code> method over combining the separate version
031:         * integers yourself.
032:         *
033:         * @author Karan Vahi
034:         * @author Jens-S. Vöckler
035:         * @version $Revision: 472 $
036:         * $Id: Version.in 472 2008-02-21 19:47:05Z gmehta $
037:         */
038:        public class Version {
039:            /**
040:             * This constant defines the major version number.
041:             */
042:            public static final int MAJOR = 2;
043:
044:            /**
045:             * This constant defines the minor version number.
046:             */
047:            public static final int MINOR = 1;
048:
049:            /**
050:             * This constant defines the patch level version.
051:             */
052:            public static final int PLEVEL = 0;
053:
054:            /**
055:             * Instance variable keeping track of the Singleton.
056:             */
057:            protected static Version c_instance = null;
058:
059:            /**
060:             * C'tor: construct an element, which is empty anyway.
061:             */
062:            private Version() {
063:                // empty
064:            }
065:
066:            /**
067:             * Accessor to the singleton.
068:             */
069:            public static Version instance() {
070:                if (Version.c_instance == null)
071:                    Version.c_instance = new Version();
072:                return Version.c_instance;
073:            }
074:
075:            /**
076:             * Returns a string containing the concatenated version.
077:             * Note: This class may also return suffixes beyond the version.
078:             *
079:             * @return a concatenated string.
080:             */
081:            public String toString() {
082:                return (Integer.toString(MAJOR) + '.' + Integer.toString(MINOR)
083:                        + '.' + Integer.toString(PLEVEL) + ""); // !! HERE !!
084:            }
085:
086:            /**
087:             * Basename of the build stamp file.
088:             */
089:            public static final String STAMP_FILENAME = "stamp";
090:
091:            /**
092:             * Determines the built as a time stamp.
093:             * @return the formatted time stamp of the built. 
094:             */
095:            public String determineBuilt() {
096:                return "20080222215700Z";
097:            }
098:
099:            /** 
100:             * Determines the build platform.
101:             * @return an identifier for the build platform.
102:             */
103:            public String determinePlatform() {
104:                return "darwin9-i386";
105:            }
106:
107:            /**
108:             * Determines the built and architecture of the installation. These
109:             * are usually separated by a linear white-space.
110:             *
111:             * @return the formatted time stamp of the built, if available, and an
112:             * identifier for the architecture. An string indicating that the
113:             * build is unknown is returned on failure.
114:             */
115:            public String determineInstalled() {
116:                String result = "unknown unknown";
117:                String pegasushome = System.getProperty("pegasus.home");
118:                if (pegasushome != null) {
119:                    try {
120:                        File stampfile = new File(pegasushome, STAMP_FILENAME);
121:                        if (stampfile.canRead()) {
122:                            BufferedReader br = new BufferedReader(
123:                                    new FileReader(stampfile));
124:                            String built = br.readLine();
125:                            br.close();
126:                            if (built != null && built.length() > 0)
127:                                result = built;
128:                        }
129:                    } catch (IOException ioe) {
130:                        // ignore
131:                    }
132:                }
133:
134:                return result;
135:            }
136:
137:            /**
138:             * Determines, if the compiled version and the installed version
139:             * match. The match is done by comparing the timestamps and
140:             * architectures.
141:             *
142:             * @return true, if versions match, false otherwise.
143:             */
144:            public boolean matches() {
145:                String s[] = determineInstalled().split("\\s+");
146:                return (s.length >= 2
147:                        && s[0].equalsIgnoreCase(determineBuilt()) && s[1]
148:                        .equalsIgnoreCase(determinePlatform()));
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.