Source Code Cross Referenced for EmittedJoinPoint.java in  » Aspect-oriented » aspectwerkz-2.0 » org » codehaus » aspectwerkz » transform » inlining » 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 » Aspect oriented » aspectwerkz 2.0 » org.codehaus.aspectwerkz.transform.inlining 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**************************************************************************************
002:         * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved.                 *
003:         * http://aspectwerkz.codehaus.org                                                    *
004:         * ---------------------------------------------------------------------------------- *
005:         * The software in this package is published under the terms of the LGPL license      *
006:         * a copy of which has been included with this distribution in the license.txt file.  *
007:         **************************************************************************************/package org.codehaus.aspectwerkz.transform.inlining;
008:
009:        import org.codehaus.aspectwerkz.joinpoint.management.JoinPointType;
010:        import org.codehaus.aspectwerkz.transform.Context;
011:        import org.objectweb.asm.Label;
012:
013:        /**
014:         * A structure that keeps required information needed to regenerate a JIT joinpoint. The weaver emits this
015:         * information so that we can add initalization code to the weaved class. Note that EmittedJP are really Emitted -
016:         * and can be a subset of actual JP (f.e. call, where information is lost in between each weave phase).
017:         *
018:         * FIXME equals and hashcode are wrong if 2 JP in same withincode - should depend on line number f.e. but that won't
019:         * even be enough. Muts have a static variable and trust that creation of EmittedJP is ok.
020:         * Check where those are used in a map for hashcode / equals to be used.
021:         *
022:         *
023:         * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
024:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
025:         */
026:        public final class EmittedJoinPoint {
027:
028:            public final static Label NO_LINE_NUMBER = new Label();
029:
030:            private final int joinPointType;
031:            private final String callerClassName;
032:            private final String callerMethodName;
033:            private final String callerMethodDesc;
034:            private final int callerMethodModifiers;
035:            private final String calleeClassName;
036:            private final String calleeMemberName;
037:            private final String calleeMemberDesc;
038:            private final int calleeMemberModifiers;
039:            private final int joinPointHash;
040:            private final String joinPointClassName;
041:            private final Label lineNumberLabel;
042:
043:            /**
044:             * Line number for call / get / set / handler joinpoint
045:             * The lineNumber is 0 unless available and resolveLineNumber(Context) has been called.
046:             */
047:            private int lineNumber = 0;
048:
049:            /**
050:             * Creates a new instance.
051:             *
052:             * @param joinPointType
053:             * @param callerClassName
054:             * @param callerMethodName
055:             * @param callerMethodDesc
056:             * @param callerMethodModifiers
057:             * @param calleeClassName
058:             * @param calleeMemberName
059:             * @param calleeMemberDesc
060:             * @param calleeMemberModifiers
061:             * @param joinPointHash
062:             * @param joinPointClassName
063:             * @param lineNumberLabel
064:             */
065:            public EmittedJoinPoint(final int joinPointType,
066:                    final String callerClassName,
067:                    final String callerMethodName,
068:                    final String callerMethodDesc,
069:                    final int callerMethodModifiers,
070:                    final String calleeClassName,
071:                    final String calleeMemberName,
072:                    final String calleeMemberDesc,
073:                    final int calleeMemberModifiers, final int joinPointHash,
074:                    final String joinPointClassName, final Label lineNumberLabel) {
075:                this .joinPointType = joinPointType;
076:                this .callerClassName = callerClassName;
077:                this .callerMethodName = callerMethodName;
078:                this .callerMethodDesc = callerMethodDesc;
079:                this .callerMethodModifiers = callerMethodModifiers;
080:                this .calleeClassName = calleeClassName;
081:                this .calleeMemberName = calleeMemberName;
082:                this .calleeMemberDesc = calleeMemberDesc;
083:                this .calleeMemberModifiers = calleeMemberModifiers;
084:                this .joinPointHash = joinPointHash;
085:                this .joinPointClassName = joinPointClassName;
086:                this .lineNumberLabel = lineNumberLabel;
087:            }
088:
089:            /**
090:             * Creates a new instance.
091:             *
092:             * @param joinPointType
093:             * @param callerClassName
094:             * @param callerMethodName
095:             * @param callerMethodDesc
096:             * @param callerMethodModifiers
097:             * @param calleeClassName
098:             * @param calleeMemberName
099:             * @param calleeMemberDesc
100:             * @param calleeMemberModifiers
101:             * @param joinPointHash
102:             * @param joinPointClassName
103:             */
104:            public EmittedJoinPoint(final int joinPointType,
105:                    final String callerClassName,
106:                    final String callerMethodName,
107:                    final String callerMethodDesc,
108:                    final int callerMethodModifiers,
109:                    final String calleeClassName,
110:                    final String calleeMemberName,
111:                    final String calleeMemberDesc,
112:                    final int calleeMemberModifiers, final int joinPointHash,
113:                    final String joinPointClassName) {
114:                this (joinPointType, callerClassName, callerMethodName,
115:                        callerMethodDesc, callerMethodModifiers,
116:                        calleeClassName, calleeMemberName, calleeMemberDesc,
117:                        calleeMemberModifiers, joinPointHash,
118:                        joinPointClassName, NO_LINE_NUMBER);
119:            }
120:
121:            public int getJoinPointType() {
122:                return joinPointType;
123:            }
124:
125:            public String getCallerClassName() {
126:                return callerClassName;
127:            }
128:
129:            public String getCallerMethodName() {
130:                return callerMethodName;
131:            }
132:
133:            public String getCallerMethodDesc() {
134:                return callerMethodDesc;
135:            }
136:
137:            public int getCallerMethodModifiers() {
138:                return callerMethodModifiers;
139:            }
140:
141:            public String getCalleeClassName() {
142:                return calleeClassName;
143:            }
144:
145:            public String getCalleeMemberName() {
146:                return calleeMemberName;
147:            }
148:
149:            public String getCalleeMemberDesc() {
150:                return calleeMemberDesc;
151:            }
152:
153:            public int getCalleeMemberModifiers() {
154:                return calleeMemberModifiers;
155:            }
156:
157:            public int getJoinPointHash() {
158:                return joinPointHash;
159:            }
160:
161:            public String getJoinPointClassName() {
162:                return joinPointClassName;
163:            }
164:
165:            public int getLineNumber() {
166:                return lineNumber;
167:            }
168:
169:            public void resolveLineNumber(Context context) {
170:                lineNumber = context.resolveLineNumberInfo(lineNumberLabel);
171:            }
172:
173:            public boolean equals(Object o) {
174:                if (this  == o) {
175:                    return true;
176:                }
177:                if (!(o instanceof  EmittedJoinPoint)) {
178:                    return false;
179:                }
180:
181:                final EmittedJoinPoint emittedJoinPoint = (EmittedJoinPoint) o;
182:
183:                if (calleeMemberModifiers != emittedJoinPoint.calleeMemberModifiers) {
184:                    return false;
185:                }
186:                if (callerMethodModifiers != emittedJoinPoint.callerMethodModifiers) {
187:                    return false;
188:                }
189:                if (joinPointHash != emittedJoinPoint.joinPointHash) {
190:                    return false;
191:                }
192:                if (joinPointType != emittedJoinPoint.joinPointType) {
193:                    return false;
194:                }
195:                if (!calleeClassName.equals(emittedJoinPoint.calleeClassName)) {
196:                    return false;
197:                }
198:                if (!calleeMemberDesc.equals(emittedJoinPoint.calleeMemberDesc)) {
199:                    return false;
200:                }
201:                if (!calleeMemberName.equals(emittedJoinPoint.calleeMemberName)) {
202:                    return false;
203:                }
204:                if (!callerClassName.equals(emittedJoinPoint.callerClassName)) {
205:                    return false;
206:                }
207:                if (!callerMethodDesc.equals(emittedJoinPoint.callerMethodDesc)) {
208:                    return false;
209:                }
210:                if (!callerMethodName.equals(emittedJoinPoint.callerMethodName)) {
211:                    return false;
212:                }
213:                if (!joinPointClassName
214:                        .equals(emittedJoinPoint.joinPointClassName)) {
215:                    return false;
216:                }
217:
218:                return true;
219:            }
220:
221:            public int hashCode() {
222:                int result;
223:                result = joinPointType;
224:                result = 29 * result + callerClassName.hashCode();
225:                result = 29 * result + callerMethodName.hashCode();
226:                result = 29 * result + callerMethodDesc.hashCode();
227:                result = 29 * result + callerMethodModifiers;
228:                result = 29 * result + calleeClassName.hashCode();
229:                result = 29 * result + calleeMemberName.hashCode();
230:                result = 29 * result + calleeMemberDesc.hashCode();
231:                result = 29 * result + calleeMemberModifiers;
232:                result = 29 * result + joinPointHash;
233:                result = 29 * result + joinPointClassName.hashCode();
234:                return result;
235:            }
236:
237:            public String toString() {
238:                StringBuffer sb = new StringBuffer();
239:                sb.append(JoinPointType.fromInt(getJoinPointType()).toString());
240:                sb.append(" , caller ");
241:                sb.append(getCallerClassName());
242:                sb.append('.').append(getCallerMethodName());
243:                sb.append(getCallerMethodDesc());
244:                sb.append(" , callee ");
245:                sb.append(getCalleeClassName());
246:                sb.append('.').append(getCalleeMemberName());
247:                sb.append(' ').append(getCalleeMemberDesc());
248:                sb.append(" , line ").append(getLineNumber());
249:                return sb.toString();
250:            }
251:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.