Source Code Cross Referenced for ExceptionThrowRequest.java in  » Byte-Code » PROSE » ch » ethz » prose » engine » 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 » Byte Code » PROSE » ch.ethz.prose.engine 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //
002:        //  This file is part of the prose package.
003:        //
004:        //  The contents of this file are subject to the Mozilla Public License
005:        //  Version 1.1 (the "License"); you may not use this file except in
006:        //  compliance with the License. You may obtain a copy of the License at
007:        //  http://www.mozilla.org/MPL/
008:        //
009:        //  Software distributed under the License is distributed on an "AS IS" basis,
010:        //  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
011:        //  for the specific language governing rights and limitations under the
012:        //  License.
013:        //
014:        //  The Original Code is prose.
015:        //
016:        //  The Initial Developer of the Original Code is Andrei Popovici. Portions
017:        //  created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
018:        //  All Rights Reserved.
019:        //
020:        //  Contributor(s):
021:        // $Id: ExceptionThrowRequest.java,v 1.1.1.1 2003/07/02 15:30:51 apopovic Exp $
022:        // =====================================================================
023:        //
024:        // (history at end)
025:        //
026:
027:        package ch.ethz.prose.engine;
028:
029:        // used packages
030:        import ch.ethz.jvmai.JoinPointKinds;
031:
032:        /**
033:         * Class ExceptionThrowRequest is a special kind of
034:         * <code>JoinPointRequest</code> which, when inserted into a
035:         * <code>JoinPointManager</code> will make the local virtual
036:         * machine to stop when it encounters an exception object beeing thrown
037:         * denoted by this request. A corresponding
038:         * <code>ExceptionThrowEvent</code> will be posted to the listeners
039:         * registered in the join point manager.
040:         * @version	$Revision: 1.1.1.1 $
041:         * @author	Philippe Schoch
042:         */
043:        public class ExceptionThrowRequest extends JoinPointRequest implements 
044:                JoinPointKinds {
045:
046:            private final Class exceptionClass;
047:
048:            /**
049:             * Constructor.
050:             * @param cls Class of the thrown Exception.
051:             * @param o Reference to the JoinPointManager to set and clear jvmai-watches.
052:             */
053:            public ExceptionThrowRequest(Class cls, JoinPointManager o)
054:                    throws ClassCastException {
055:                super (o);
056:
057:                try {
058:                    if (!(Class.forName("java.lang.Throwable")
059:                            .isAssignableFrom(cls)))
060:                        throw new ClassCastException(
061:                                "ClassCastException: Class must be of subtype 'Throwable'");
062:                } catch (ClassNotFoundException e) {
063:                    System.err.println(e);
064:                    e.printStackTrace();
065:                }
066:
067:                exceptionClass = cls;
068:            }
069:
070:            public int getMask() {
071:                return MASK_EXCEPTION_THROW_ARGS_JP;
072:            }
073:
074:            public String getKind() {
075:                return KIND_EXCEPTION_THROW_ARGS_JP;
076:            }
077:
078:            public Class getExceptionClass() {
079:                return exceptionClass;
080:            }
081:
082:            protected void setWatch(Object listeners) {
083:                owner.getAspectInterface().setExceptionThrowWatch(
084:                        exceptionClass, listeners);
085:            }
086:
087:            protected void clearWatch() {
088:                owner.getAspectInterface().clearExceptionThrowWatch(
089:                        exceptionClass);
090:            }
091:
092:            public boolean equals(Object other) {
093:                ExceptionThrowRequest otherReq;
094:                if (other instanceof  ExceptionThrowRequest)
095:                    otherReq = (ExceptionThrowRequest) other;
096:                else
097:                    return false;
098:                return exceptionClass.equals(otherReq.getExceptionClass());
099:            }
100:
101:            public int hashCode() {
102:                return exceptionClass.hashCode();
103:            }
104:
105:            public String toString() {
106:                return "ExceptionThrowRequest on Class "
107:                        + exceptionClass.getName();
108:            }
109:
110:        }
111:
112:        //======================================================================
113:        //
114:        // $Log: ExceptionThrowRequest.java,v $
115:        // Revision 1.1.1.1  2003/07/02 15:30:51  apopovic
116:        // Imported from ETH Zurich
117:        //
118:        // Revision 1.3  2003/05/20 16:05:03  popovici
119:        //
120:        // New QueryManager replaces functionality in AspectManager (better Soc)
121:        // New 'Surrogate' classes for usage in the QueryManager
122:        // The 'RemoteAspectManager' and tools modified to use the Surrogates and the QueryManager
123:        //
124:        // Revision 1.2  2003/05/06 15:51:33  popovici
125:        // Mozilla-ification
126:        //
127:        // Revision 1.1  2003/05/05 13:58:25  popovici
128:        // renaming from runes to prose
129:        //
130:        // Revision 1.7  2003/04/26 18:51:36  popovici
131:        // 1 Bug fix which lead to a refactoring step:
132:        //    1. the bug: 'JoinPointRequests' used to write to a static list, which survived a startup/teardown;
133:        //                now this list belongs to the JoinPointManager;
134:        //    2. the refactoring: the JoinPointManager now creates (and shares state) with join-points.
135:        //
136:        // Revision 1.6  2003/04/17 12:49:28  popovici
137:        // Refactoring of the crosscut package
138:        //  ExceptionCut renamed to ThrowCut
139:        //  McutSignature is now SignaturePattern
140:        //
141:        // Revision 1.5  2003/04/17 08:47:57  popovici
142:        // Important functionality additions
143:        //  - Cflow specializers
144:        //  - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
145:        //  - Transactional capabilities
146:        //  - Total refactoring of Specializer evaluation, which permits fine-grained distinction
147:        //    between static and dynamic specializers.
148:        //  - Functionality pulled up in abstract classes
149:        //  - Uniformization of advice methods patterns and names
150:        //
151:        // Revision 1.4  2003/03/04 18:36:04  popovici
152:        // Organization of imprts
153:        //
154:        // Revision 1.3  2003/03/04 11:27:27  popovici
155:        // Important refactorization step (march):
156:        // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
157:        // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
158:        //   structures
159:        //
160:        // Revision 1.2  2003/01/17 12:16:57  pschoch
161:        // Bugfix in the 'equals' method
162:        //
163:        // Revision 1.1  2002/10/31 18:26:55  pschoch
164:        // Capability of crosscutting Exceptions added to prose.
165:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.