Source Code Cross Referenced for DefaultAspect.java in  » Byte-Code » PROSE » ch » ethz » prose » 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 
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: DefaultAspect.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
022:        // =====================================================================
023:        //
024:        // (history at end)
025:        //
026:
027:        package ch.ethz.prose;
028:
029:        // used packages
030:        import java.lang.reflect.Field;
031:        import java.util.Vector;
032:
033:        import ch.ethz.prose.crosscut.Crosscut;
034:        import ch.ethz.inf.util.Logger;
035:
036:        /**
037:         * Class DefaultAspect provides a declarative way to define
038:         * an extension. For example, the following code
039:         * <blockquote><pre>
040:         * class MyExtension extends DefaultAspect
041:         * {
042:         *   Crosscut c1 = new MethodCut()
043:         *                 {
044:         *                    public void METHOD_ARGS(ANY thisO,REST params) {}
045:         *                 }
046:         *   Crosscut c2 = new MethodCut{}
047:         *                 {
048:         *                    public void adviceMethod(Object thisO, Object[] parms){}
049:         *                 }.specializeWith(  ( MethodS.BEFORE1)       .AND
050:         *                                    ( MethodS.named("Foo"))       );
051:         *
052:         * }
053:         *
054:         * </pre></blockquote>
055:         * would produce an extension which returns a list of two crosscuts
056:         * <code>c1</code> and <code>c2</code>.
057:         *
058:         *
059:         * @version	$Revision: 1.1.1.1 $
060:         * @author	Andrei Popovici
061:         */
062:        public abstract class DefaultAspect extends Aspect {
063:
064:            protected Crosscut[] crosscuts() {
065:                Vector theCrosscuts = null;
066:                try {
067:                    theCrosscuts = new Vector();
068:                    Field[] declFields = getClass().getDeclaredFields();
069:                    for (int i = 0; i < declFields.length; i++) {
070:                        if (Crosscut.class.isAssignableFrom(declFields[i]
071:                                .getType())
072:                                && (declFields[i].get(this ) != null))
073:                            theCrosscuts.add(declFields[i].get(this ));
074:                    }
075:                } catch (IllegalAccessException probablyPrivate) {
076:                    Logger.error("Probably private definition:",
077:                            probablyPrivate);
078:                    throw new IllegalAspectException(
079:                            " Probably private crosscut definitions:"
080:                                    + probablyPrivate.toString());
081:                }
082:
083:                return (Crosscut[]) (theCrosscuts.toArray(new Crosscut[] {}));
084:            }
085:
086:        }
087:
088:        //======================================================================
089:        //
090:        // $Log: DefaultAspect.java,v $
091:        // Revision 1.1.1.1  2003/07/02 15:30:50  apopovic
092:        // Imported from ETH Zurich
093:        //
094:        // Revision 1.2  2003/05/26 13:28:49  popovici
095:        // Documentation Improvements
096:        //
097:        // Revision 1.1  2003/05/05 13:58:31  popovici
098:        // renaming from runes to prose
099:        //
100:        // Revision 1.4  2003/04/29 12:41:04  popovici
101:        // Feature added:
102:        // - the 'setPriority' in class insertable allows now Aspects and Crosscuts to have a priority.
103:        //   Notitification is done from low int priorities to high int priorities.
104:        // - the 'setAspectID' introduced to replace constuctor; used to be cumberstone for subclasses
105:        //
106:        // Revision 1.3  2003/04/27 13:21:32  popovici
107:        // Aspects now have identities. Equality is based
108:        // either on an ad-hoc identity, or on a specific
109:        // name given by the user
110:        //
111:        // Revision 1.2  2003/04/17 15:43:45  popovici
112:        // crosscuts renamed to 'getCrosscuts'
113:        // createCrosscuts renamed to 'crosscuts'
114:        //
115:        // Revision 1.1  2003/04/17 15:15:12  popovici
116:        // Extension->Aspect renaming
117:        //
118:        // Revision 1.8  2003/04/17 13:54:35  popovici
119:        // Refactorization of 'ExecutionS' into 'Within' and 'Executions'.
120:        // Method names refer now to 'types'
121:        //
122:        // Revision 1.7  2003/04/17 12:49:41  popovici
123:        // Refactoring of the crosscut package
124:        //  ExceptionCut renamed to ThrowCut
125:        //  McutSignature is now SignaturePattern
126:        //
127:        // Revision 1.6  2003/04/17 08:47:12  popovici
128:        // Important functionality additions
129:        //  - Cflow specializers
130:        //  - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
131:        //  - Transactional capabilities
132:        //  - Total refactoring of Specializer evaluation, which permits fine-grained distinction
133:        //    between static and dynamic specializers.
134:        //  - Functionality pulled up in abstract classes
135:        //  - Uniformization of advice methods patterns and names
136:        //
137:        // Revision 1.5  2003/03/04 18:36:37  popovici
138:        // Organization of imprts
139:        //
140:        // Revision 1.4  2002/06/07 15:30:49  popovici
141:        // Documentation updates of FunctionalCrosscut/ClasseS refactorings
142:        //
143:        // Revision 1.3  2002/03/28 13:48:33  popovici
144:        // Mozilla-ified
145:        //
146:        // Revision 1.2  2002/02/05 10:17:22  smarkwal
147:        // JVMDI-specific code replaced by JVMAI. Implementation-classes and reflection-package removed.
148:        //
149:        // Revision 1.1.1.1  2001/11/29 18:13:14  popovici
150:        // Sources from runes
151:        //
152:        // Revision 1.1.2.7  2001/06/01 11:29:04  popovici
153:        // Generation of birthdaykookie changed, in order to avoid collsions of
154:        // extensions created one after the other. A sequence number is now
155:        // included in the cookie.
156:        //
157:        // Revision 1.1.2.6  2001/02/21 16:43:46  popovici
158:        // Methods 'equals' and 'hashCode' added.
159:        //
160:        // Revision 1.1.2.5  2001/02/21 13:24:25  popovici
161:        // Logging messages added.
162:        //
163:        // Revision 1.1.2.4  2001/02/15 10:21:55  popovici
164:        // The mapping threads to maps is now transient.
165:        //
166:        // Revision 1.1.2.3  2001/02/07 11:46:31  popovici
167:        // Void method 'insertionAction' and 'withdrawalAction' added.
168:        //
169:        // Revision 1.1.2.2  2000/11/13 19:00:20  popovici
170:        // More explicit IllegalExtension exception
171:        //
172:        // Revision 1.1.2.1  2000/10/24 17:47:59  popovici
173:        // Initial Revision
174:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.