Source Code Cross Referenced for JaxpCheck.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » tools » checks » 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 » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.tools.checks 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2005 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal.tools.checks;
007:
008:        /**
009:         * Checks that JAXP is present in the JVM. This allows us to give a
010:         * useful error back to the deployer if we find JAXP missing. Instead of getting many
011:         * class not found errors the deployer will see a message instructing how to fix
012:         * the problem.
013:         * 
014:         * JaxpCheck fulfills two purposes.  First, it is an executable class which will
015:         * make an educated guess at whether the JAXP jars are present (by checking for
016:         * a particular class found only in the JAXP distribution) and if it guesses we're
017:         * missing those jars will report this error to System.err and return a nonzero
018:         * return code.  A nonzero return value from a main method stop an Ant build
019:         * when the class was run with stopOnFailure declared to true, as it is by default
020:         * in our build.xml.
021:         * 
022:         * Second, JaxpCheck implements the ICheck interface and so can be used via the 
023:         * CheckRunner API in this package.  This allows us to run this check as part of the
024:         * context initialization sanity checking.  An instance of this check is configured in
025:         * 
026:         * 
027:         * @version $Revision: 35837 $ $Date: 2005-05-20 12:01:34 -0700 (Fri, 20 May 2005) $
028:         * @since uPortal 2.5
029:         */
030:        public class JaxpCheck implements  ICheck {
031:
032:            /**
033:             * The name of a class found only in the JAXP distribution.
034:             */
035:            private static final String A_JAXP_CLASS = "javax.xml.xpath.XPathConstants";
036:
037:            /**
038:             * ICheck implementation to which we delegate as the way we
039:             * implement ICheck.
040:             */
041:            private ICheck checkDelegate;
042:
043:            public static void main(String[] args) {
044:                try {
045:                    Class c = JaxpCheck.class.getClassLoader().loadClass(
046:                            A_JAXP_CLASS);
047:                } catch (ClassNotFoundException e) {
048:                    System.err.println(e);
049:                    System.err
050:                            .println("The missing class is provided as part of JAXP.\n"
051:                                    + "Check that you have the JAXP jars installed in your JDK.\n"
052:                                    + "For more information see lib/jaxp/README.txt.");
053:                    System.exit(1);
054:                }
055:                System.exit(0);
056:            }
057:
058:            public JaxpCheck() {
059:                super ();
060:
061:                /*
062:                 * We implement the ICheck interface by delegation to an instance of
063:                 * ClassPresenceCheck, which we configure here.
064:                 */
065:
066:                ClassPresenceCheck check = new ClassPresenceCheck(A_JAXP_CLASS);
067:                check
068:                        .setDescription("Check for the presence of the class "
069:                                + A_JAXP_CLASS
070:                                + ", which will only be present when JAXP 1.3 or better is installed.");
071:
072:                CheckResult failureResult = CheckResult
073:                        .createFailure(
074:                                "The class "
075:                                        + A_JAXP_CLASS
076:                                        + " was not present.  This class is part of the JAXP 1.3 distribution.",
077:                                "Install the JAXP 1.3 jars into your JDK and into your servlet container as described in /lib/jaxp/README.txt");
078:                check.setFailureResult(failureResult);
079:
080:                CheckResult successResult = CheckResult
081:                        .createSuccess("The class "
082:                                + A_JAXP_CLASS
083:                                + " was present.  "
084:                                + "This class is part of the JAXP 1.3 distribution and its presence "
085:                                + "suggests that JAXP 1.3 is properly installed.");
086:                check.setSuccessResult(successResult);
087:
088:                this .checkDelegate = check;
089:
090:            }
091:
092:            public CheckResult doCheck() {
093:                // we implement this interface method by delegation
094:                return this .checkDelegate.doCheck();
095:            }
096:
097:            public String getDescription() {
098:                // we implement this interface method by delegation
099:                return this.checkDelegate.getDescription();
100:            }
101:
102:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.