Source Code Cross Referenced for BuildInformation.java in  » UML » AndroMDA-3.2 » org » andromda » core » common » 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 » UML » AndroMDA 3.2 » org.andromda.core.common 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.andromda.core.common;
002:
003:        import java.io.InputStream;
004:
005:        import java.net.URL;
006:
007:        import java.util.Properties;
008:
009:        /**
010:         * This class provides statistics on how the build was performed.
011:         *
012:         * @author Martin West
013:         * @author Chad Brandon
014:         */
015:        public class BuildInformation {
016:            /**
017:             * The shared instance.
018:             */
019:            private static final BuildInformation instance = new BuildInformation();
020:
021:            /**
022:             * Gets the shared instance of the BuildInformation.
023:             *
024:             * @return the shared BuildInformation instance.
025:             */
026:            public static BuildInformation instance() {
027:                return instance;
028:            }
029:
030:            /**
031:             * Private default constructor of BuildInformation. This class is not intended to be instantiated.
032:             */
033:            private BuildInformation() {
034:                this .initialize();
035:            }
036:
037:            /**
038:             * The build timestamp.
039:             */
040:            private String buildDate;
041:
042:            /**
043:             * The build operating system and version.
044:             */
045:            private String buildSystem;
046:
047:            /**
048:             * The JDK details used to build the system.
049:             */
050:            private String buildJdk;
051:
052:            /**
053:             * The name of the user that built the system.
054:             */
055:            private String buildBuilder;
056:
057:            /**
058:             * The version of the AndroMDA build.
059:             */
060:            private String buildVersion;
061:
062:            private void initialize() {
063:                final String buildPropertiesUri = "META-INF/andromda-build.properties";
064:                final String versionPropertyName = "andromda.build.version";
065:                final String datePropertyName = "andromda.build.date";
066:                final String systemPropertyName = "andromda.build.system";
067:                final String jdkPropertyName = "andromda.build.jdk";
068:                final String builderPropertyName = "andromda.build.builder";
069:                final URL versionUri = ResourceUtils
070:                        .getResource(buildPropertiesUri);
071:                try {
072:                    if (versionUri == null) {
073:                        throw new IllegalStateException(
074:                                "BuildInformation: could not load file --> '"
075:                                        + buildPropertiesUri + "'");
076:                    }
077:                    final Properties properties = new Properties();
078:                    InputStream stream = versionUri.openStream();
079:                    properties.load(stream);
080:                    stream.close();
081:                    stream = null;
082:                    this .buildDate = properties.getProperty(datePropertyName);
083:                    this .buildSystem = properties
084:                            .getProperty(systemPropertyName);
085:                    this .buildJdk = properties.getProperty(jdkPropertyName);
086:                    this .buildBuilder = properties
087:                            .getProperty(builderPropertyName);
088:                    this .buildVersion = properties
089:                            .getProperty(versionPropertyName);
090:                } catch (final Throwable throwable) {
091:                    ExceptionRecorder.instance().record(throwable);
092:                    throw new IllegalStateException(throwable.getMessage());
093:                }
094:            }
095:
096:            /**
097:             * Return the name of the operating system and version.
098:             *
099:             * @return Returns the build version.
100:             */
101:            public String getBuildVersion() {
102:                return this .buildVersion;
103:            }
104:
105:            /**
106:             * Return the user name of the id which built the system.
107:             *
108:             * @return Returns the build builder.
109:             */
110:            public String getBuildBuilder() {
111:                return this .buildBuilder;
112:            }
113:
114:            /**
115:             * Return the timestamp of the build.
116:             *
117:             * @return Returns the build date.
118:             */
119:            public String getBuildDate() {
120:                return this .buildDate;
121:            }
122:
123:            /**
124:             * Return the vendor and jdk version.
125:             *
126:             * @return Returns the build jdk.
127:             */
128:            public String getBuildJdk() {
129:                return this .buildJdk;
130:            }
131:
132:            /**
133:             * Return the name of the operating system and version.
134:             *
135:             * @return Returns the build system.
136:             */
137:            public String getBuildSystem() {
138:                return this.buildSystem;
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.