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


001:        /* Copyright 2004 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.channels.error;
007:
008:        /**
009:         * Error codes specific to the CError channel.
010:         * @author andrew.petro@yale.edu
011:         * @version $Revision: 35593 $ $Date: 2005-04-17 13:54:14 -0700 (Sun, 17 Apr 2005) $
012:         * @since uPortal 2.5
013:         */
014:        public class ErrorCode {
015:
016:            /** Generic error code */
017:            public static final ErrorCode UNKNOWN_ERROR = new ErrorCode(
018:                    "unknown error", -1, true);
019:
020:            /** Generic error code */
021:            public static final ErrorCode GENERAL_ERROR = new ErrorCode(
022:                    "general error", 0, true);
023:
024:            /** Error code for failure during rendering. */
025:            public static final ErrorCode RENDER_TIME_EXCEPTION = new ErrorCode(
026:                    "Render time exception", 1, true);
027:
028:            /** Error code for errors at time static data is set */
029:            public static final ErrorCode SET_STATIC_DATA_EXCEPTION = new ErrorCode(
030:                    "Set static data exception", 2, false);
031:
032:            /** Error code for errors at time runtime data is set. */
033:            public static final ErrorCode SET_RUNTIME_DATA_EXCEPTION = new ErrorCode(
034:                    "Set runtime data", 3, true);
035:
036:            /** Error code for channels that fail to complete rendering during
037:             * allotted time.
038:             */
039:            public static final ErrorCode TIMEOUT_EXCEPTION = new ErrorCode(
040:                    "Rendering timeout", 4, true);
041:
042:            /** Error code representing failure when framework attempts to set
043:             * channel portal control structures.
044:             */
045:            public static final ErrorCode SET_PCS_EXCEPTION = new ErrorCode(
046:                    "Set PCS exception", 5, true);
047:
048:            /**
049:             * Error code representing failure to render due to lack of authorization.
050:             */
051:            public static final ErrorCode CHANNEL_AUTHORIZATION_EXCEPTION = new ErrorCode(
052:                    "Channel authorization exception", 6, false);
053:
054:            /**
055:             * Error code representing the channel being just plain missing.
056:             */
057:            public static final ErrorCode CHANNEL_MISSING_EXCEPTION = new ErrorCode(
058:                    "Channel missing", 7, false);
059:
060:            private static ErrorCode[] codeArray = { GENERAL_ERROR,
061:                    RENDER_TIME_EXCEPTION, SET_STATIC_DATA_EXCEPTION,
062:                    SET_RUNTIME_DATA_EXCEPTION, TIMEOUT_EXCEPTION,
063:                    SET_PCS_EXCEPTION, CHANNEL_AUTHORIZATION_EXCEPTION,
064:                    CHANNEL_MISSING_EXCEPTION };
065:
066:            /**
067:             * Obtain the ErrorCode for the given code number, or null if the
068:             * code number does not correspond to an error code.
069:             * @param codeNum
070:             * @return ErrorCode or null.
071:             */
072:            public static ErrorCode codeForInt(int codeNum) {
073:                ErrorCode code = UNKNOWN_ERROR;
074:                if (codeNum > -1 && codeNum < codeArray.length)
075:                    code = codeArray[codeNum];
076:                return code;
077:            }
078:
079:            /**
080:             * Integer representing error code.
081:             */
082:            private final int codeNumber;
083:
084:            /**
085:             * String label suggesting meaning of error code.
086:             */
087:            private final String label;
088:
089:            /**
090:             * True if channel refresh is an appropriate response to this error, 
091:             * false otherwise.
092:             */
093:            private boolean refreshable;
094:
095:            /**
096:             * Private constructor.
097:             * @param label - briefly describes error type
098:             * @param codeNumber - integer representing error type
099:             * @param refreshable - whether refresh is appropriate response
100:             */
101:            private ErrorCode(final String label, final int codeNumber,
102:                    final boolean refreshable) {
103:                this .label = label;
104:                this .codeNumber = codeNumber;
105:                this .refreshable = refreshable;
106:            }
107:
108:            public int getCode() {
109:                return this .codeNumber;
110:            }
111:
112:            public String getLabel() {
113:                return this .label;
114:            }
115:
116:            /**
117:             * Is this ErrorCode representative of a problem to which
118:             * channel refresh would be an appropriate response.
119:             * Some ErrorCodes are representative of problems that refreshing just
120:             * won't fix, such as a failure when setting static data.
121:             * @return true if refresh is allowed, false otherwise
122:             */
123:            public boolean isRefreshAllowed() {
124:                return this .refreshable;
125:            }
126:
127:            public String toString() {
128:                return this.label;
129:            }
130:
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.