Source Code Cross Referenced for ResourceException.java in  » EJB-Server-JBoss-4.2.1 » j2ee » javax » resource » 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 » EJB Server JBoss 4.2.1 » j2ee » javax.resource 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JBoss, Home of Professional Open Source.
003:         * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004:         * as indicated by the @author tags. See the copyright.txt file in the
005:         * distribution for a full listing of individual contributors.
006:         *
007:         * This is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU Lesser General Public License as
009:         * published by the Free Software Foundation; either version 2.1 of
010:         * the License, or (at your option) any later version.
011:         *
012:         * This software is distributed in the hope that it will be useful,
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015:         * Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public
018:         * License along with this software; if not, write to the Free
019:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021:         */
022:        package javax.resource;
023:
024:        import org.jboss.util.id.SerialVersion;
025:
026:        /**
027:         * This is the root exception for the exception hierarchy defined for the
028:         * connector architecture.
029:         *
030:         * A ResourceException contains three items, the first two of which are set from
031:         * the constructor. The first is a standard message string which is accessed via
032:         * the getMessage() method. The second is an errorCode which is accessed via the
033:         * getErrorCode() method. The third is a linked exception which provides more
034:         * information from a lower level in the resource manager. Linked exceptions are
035:         * accessed via get/setLinkedException.
036:         */
037:        public class ResourceException extends Exception {
038:            /** @since 4.0.2 */
039:            static final long serialVersionUID;
040:            static {
041:                if (SerialVersion.version == SerialVersion.LEGACY)
042:                    serialVersionUID = 4770679801401540475L;
043:                else
044:                    serialVersionUID = 547071213627824490L;
045:            }
046:
047:            /**
048:             * The error code
049:             */
050:            private String errorCode;
051:
052:            /**
053:             * The linked exception
054:             */
055:            private Exception linkedException;
056:
057:            /**
058:             * Create an exception with a null reason.
059:             */
060:            public ResourceException() {
061:                super ();
062:            }
063:
064:            /**
065:             * Create an exception with a reason.
066:             * @param reason the reason
067:             */
068:            public ResourceException(String reason) {
069:                super (reason);
070:            }
071:
072:            /**
073:             * Create an exception with a reason and an errorCode.
074:             * @param reason the reason
075:             * @param errorCode the error code
076:             */
077:            public ResourceException(String reason, String errorCode) {
078:                super (reason);
079:                this .errorCode = errorCode;
080:            }
081:
082:            /**
083:             * Create an exception with a reason and an errorCode.
084:             * @param reason the reason
085:             * @param throwable the linked error
086:             */
087:            public ResourceException(String reason, Throwable throwable) {
088:                super (reason, throwable);
089:            }
090:
091:            /**
092:             * Create an exception with a reason and an errorCode.
093:             * @param throwable the linked error
094:             */
095:            public ResourceException(Throwable throwable) {
096:                super (throwable);
097:            }
098:
099:            /**
100:             * Get the error code.
101:             * @return the error code
102:             */
103:            public String getErrorCode() {
104:                return errorCode;
105:            }
106:
107:            /**
108:             * Get any linked exception.
109:             * @return the linked exception
110:             */
111:            public Exception getLinkedException() {
112:                return linkedException;
113:            }
114:
115:            /**
116:             * Get the message composed of the reason and error code.
117:             * 
118:             * @return message composed of the reason and error code.
119:             */
120:            public String getMessage() {
121:                String msg = super .getMessage();
122:                String ec = getErrorCode();
123:                if ((msg == null) && (ec == null)) {
124:                    return null;
125:                }
126:                if ((msg != null) && (ec != null)) {
127:                    return (msg + ", error code: " + ec);
128:                }
129:                return ((msg != null) ? msg : ("error code: " + ec));
130:            }
131:
132:            /**
133:             * Set the error code.
134:             * @param errorCode code the error code
135:             */
136:            public void setErrorCode(String errorCode) {
137:                this .errorCode = errorCode;
138:            }
139:
140:            /**
141:             * Set a linked exception.
142:             * @param linkedException the linked exception
143:             * @deprecated use initCause
144:             */
145:            public void setLinkedException(Exception linkedException) {
146:                this.linkedException = linkedException;
147:                initCause(linkedException);
148:            }
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.