Source Code Cross Referenced for ReflectException.java in  » Web-Framework » rife-1.6.1 » tcl » lang » 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 » Web Framework » rife 1.6.1 » tcl.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * ReflectException.java --
03:         *
04:         *	The file implements the handling of the Exception's caught
05:         *	while invoking the Reflection API.
06:         *
07:         * Copyright (c) 1997 Sun Microsystems, Inc.
08:         *
09:         * See the file "license.terms" for information on usage and
10:         * redistribution of this file, and for a DISCLAIMER OF ALL
11:         * WARRANTIES.
12:         * 
13:         * RCS: @(#) $Id: ReflectException.java 3308 2006-06-15 18:54:14Z gbevin $
14:         *
15:         */
16:        package tcl.lang;
17:
18:        import java.lang.reflect.*;
19:
20:        /**
21:         * This class handles Exception's caught while invoking the Reflection
22:         * API. It records the string form of the Exception into the result
23:         * of the interpreter and stores the actual Exception object in the
24:         * errorCode of the interpreter.
25:         */
26:
27:        public class ReflectException extends TclException {
28:
29:            /*
30:             *----------------------------------------------------------------------
31:             *
32:             * ReflectException --
33:             *
34:             *	Records the string form of the Exception into the result
35:             *	of the interpreter and stores the actual Exception object in the
36:             *	errorCode of the interpreter.
37:             *
38:             * Results:
39:             * 	None.
40:             *
41:             * Side effects:
42:             *	If interp is non-null, the interpreter result and errorCode
43:             *	are modified
44:             *
45:             *----------------------------------------------------------------------
46:             */
47:
48:            private static final long serialVersionUID = 4651756357452262833L;
49:
50:            public ReflectException(Interp interp, // Current interpreter. May be null.
51:                    // If non-null, its result object and
52:                    // errorCode variable will be changed.
53:                    Throwable e) // The exception to record in the interp.
54:            {
55:                super (TCL.ERROR);
56:                initCause(e);
57:
58:                if (interp != null) {
59:                    Throwable t = e;
60:                    if (t instanceof  InvocationTargetException) {
61:                        // The original exception is wrapped in InvocationTargetException
62:                        // for us by the Java Reflection API. This fact doesn't provide
63:                        // any interesting information to script writers, so we'll
64:                        // unwrap it so that is more convenient for scripts to
65:                        // figure out the exception.
66:
67:                        t = ((InvocationTargetException) t)
68:                                .getTargetException();
69:                    }
70:
71:                    TclObject errCode = TclList.newInstance();
72:                    errCode.preserve();
73:
74:                    try {
75:                        TclList.append(interp, errCode, TclString
76:                                .newInstance("JAVA"));
77:                        TclList.append(interp, errCode, ReflectObject
78:                                .newInstance(interp, Throwable.class, t));
79:                    } catch (TclException tclex) {
80:                        throw new TclRuntimeError("unexpected TclException: "
81:                                + tclex);
82:                    }
83:
84:                    // interp.setErrorCode() may fail silently if there is an bad
85:                    // trace on the "errorCode" variable. If that happens, the
86:                    // errCode list we created above may hang around
87:                    // forever. Hence, we added the pair of preserve() + release()
88:                    // calls to ensure that errCode will get cleaned up if
89:                    // interp.setErrorCode() fails.
90:
91:                    interp.setErrorCode(errCode);
92:                    errCode.release();
93:
94:                    interp.setResult(t.toString());
95:                }
96:            }
97:
98:        } // end ReflectException
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.