Source Code Cross Referenced for ProfilerException.java in  » Portal » Open-Portal » com » sun » portal » subscriptions » profiler » 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 » Open Portal » com.sun.portal.subscriptions.profiler 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
003:         *  PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:        package com.sun.portal.subscriptions.profiler;
006:
007:        import java.io.PrintWriter;
008:
009:        public class ProfilerException extends Exception {
010:
011:            /**
012:             *  Description of the Field
013:             */
014:            public final static String RESOURCE_BASE = "profiler";
015:
016:            /**
017:             *  Description of the Field
018:             */
019:            protected static java.util.Locale locale = java.util.Locale
020:                    .getDefault();
021:
022:            /**
023:             *  Description of the Field
024:             */
025:            protected java.lang.Throwable origEx = null;
026:            /**
027:             *  Description of the Field
028:             */
029:            protected java.lang.String key = null;
030:            /**
031:             *  Description of the Field
032:             */
033:            protected java.lang.Object[] tokens = null;
034:
035:            /*
036:             *  CONSTRUCTORS
037:             */
038:            /**
039:             *Constructor for the ProfilerException object
040:             *
041:             * @param  key  Description of the Parameter
042:             */
043:            public ProfilerException(java.lang.String key) {
044:                super (key);
045:                this .key = key;
046:            }
047:
048:            /**
049:             *Constructor for the ProfilerException object
050:             *
051:             * @param  key     Description of the Parameter
052:             * @param  tokens  Description of the Parameter
053:             */
054:            public ProfilerException(java.lang.String key,
055:                    java.lang.Object[] tokens) {
056:                super (key);
057:                this .key = key;
058:                this .tokens = tokens;
059:            }
060:
061:            /**
062:             *Constructor for the ProfilerException object
063:             *
064:             * @param  key  Description of the Parameter
065:             * @param  t    Description of the Parameter
066:             */
067:            public ProfilerException(java.lang.String key, java.lang.Throwable t) {
068:                super (key);
069:                origEx = t;
070:                this .key = key;
071:            }
072:
073:            /**
074:             *Constructor for the ProfilerException object
075:             *
076:             * @param  key     Description of the Parameter
077:             * @param  t       Description of the Parameter
078:             * @param  tokens  Description of the Parameter
079:             */
080:            public ProfilerException(java.lang.String key,
081:                    java.lang.Throwable t, java.lang.Object[] tokens) {
082:                super (key);
083:                origEx = t;
084:                this .key = key;
085:                this .tokens = tokens;
086:            }
087:
088:            /**
089:             *Constructor for the ProfilerException object
090:             *
091:             * @param  t  Description of the Parameter
092:             */
093:            public ProfilerException(java.lang.Throwable t) {
094:                super (t.getMessage());
095:                origEx = t;
096:            }
097:
098:            /**
099:             *  Sets the locale attribute of the ProfilerException class
100:             *
101:             * @param  loc  The new locale value
102:             */
103:            public static void setLocale(java.util.Locale loc) {
104:                locale = loc;
105:            }
106:
107:            /**
108:             *  Gets the message attribute of the ProfilerException object
109:             *
110:             * @return    The message value
111:             */
112:            public String getMessage() {
113:                // non-localized resource bundle
114:                java.util.ResourceBundle rb = java.util.PropertyResourceBundle
115:                        .getBundle(RESOURCE_BASE, java.util.Locale.getDefault());
116:                return getMessageFromRB(rb, key, tokens);
117:            }
118:
119:            /**
120:             *  Gets the wrapped attribute of the ProfilerException object
121:             *
122:             * @return    The wrapped value
123:             */
124:            public Throwable getWrapped() {
125:                return origEx;
126:            }
127:
128:            /**
129:             *  Gets the wrappedMessage attribute of the ProfilerException object
130:             *
131:             * @return    The wrappedMessage value
132:             */
133:            public String getWrappedMessage() {
134:                String msg = null;
135:                if (origEx != null) {
136:                    msg = origEx.getMessage();
137:                }
138:                return msg;
139:            }
140:
141:            /**
142:             *  Gets the localizedMessage attribute of the ProfilerException object
143:             *
144:             * @return    The localizedMessage value
145:             */
146:            public String getLocalizedMessage() {
147:                // localized resource bundle
148:                java.util.ResourceBundle rb = java.util.PropertyResourceBundle
149:                        .getBundle(RESOURCE_BASE, locale);
150:                String msg = null;
151:                try {
152:                    msg = getMessageFromRB(rb, key, tokens);
153:                } catch (java.util.MissingResourceException mrex) {
154:                    msg = key;
155:                }
156:                return msg;
157:            }
158:
159:            /**
160:             *  Gets the messageFromRB attribute of the ProfilerException object
161:             *
162:             * @param  rb                                      Description of the Parameter
163:             * @param  key                                     Description of the Parameter
164:             * @param  tokens                                  Description of the Parameter
165:             * @return                                         The messageFromRB value
166:             * @exception  java.util.MissingResourceException  Description of the Exception
167:             */
168:            private String getMessageFromRB(java.util.ResourceBundle rb,
169:                    java.lang.String key, java.lang.Object[] tokens)
170:                    throws java.util.MissingResourceException {
171:
172:                String msg = rb.getString(key);
173:
174:                if (tokens != null && tokens.length > 0) {
175:                    java.text.MessageFormat mf = new java.text.MessageFormat("");
176:                    mf.setLocale(rb.getLocale());
177:                    mf.applyPattern(msg);
178:                    return mf.format(tokens);
179:                } else {
180:                    return msg;
181:                }
182:            }
183:
184:            /**
185:             *  Description of the Method
186:             */
187:            public void printStackTrace() {
188:                if (origEx != null) {
189:                    origEx.printStackTrace();
190:                } else {
191:                    super .printStackTrace();
192:                }
193:            }
194:
195:            /**
196:             *  Description of the Method
197:             *
198:             * @param  pw  Description of the Parameter
199:             */
200:            public void printStackTrace(PrintWriter pw) {
201:                if (origEx != null) {
202:                    origEx.printStackTrace(pw);
203:                } else {
204:                    super.printStackTrace(pw);
205:                }
206:            }
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.