Source Code Cross Referenced for AdviceInfo.java in  » Net » Terracotta » com » tc » aspectwerkz » aspect » 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 » Net » Terracotta » com.tc.aspectwerkz.aspect 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tc.aspectwerkz.aspect;
005:
006:        import com.tc.asm.Type;
007:
008:        import com.tc.aspectwerkz.DeploymentModel;
009:        import com.tc.aspectwerkz.expression.ExpressionInfo;
010:        import com.tc.aspectwerkz.expression.ExpressionContext;
011:        import com.tc.aspectwerkz.definition.AdviceDefinition;
012:        import com.tc.aspectwerkz.transform.inlining.AsmHelper;
013:
014:        import java.io.Serializable;
015:
016:        /**
017:         * Contains advice info, like indexes describing the aspect and a method (advice or introduced),
018:         * aspect manager etc.
019:         *
020:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
021:         * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
022:         */
023:        public class AdviceInfo implements  Serializable {
024:
025:            public final static AdviceInfo[] EMPTY_ADVICE_INFO_ARRAY = new AdviceInfo[0];
026:
027:            // -- some magic index used in the m_methodToArgIndexes[] so that we know what to bind except advised target args
028:            // -- those constants MUST be negative since positive values are used for args(..) binding
029:            public final static int JOINPOINT_ARG = -0x1;
030:            public final static int STATIC_JOINPOINT_ARG = -0x2;
031:            public final static int TARGET_ARG = -0x3;
032:            public final static int THIS_ARG = -0x4;
033:            public final static int VALID_NON_AW_AROUND_CLOSURE_TYPE = -0x5;
034:            public final static int SPECIAL_ARGUMENT = -0x6;
035:            public static final int CUSTOM_JOIN_POINT_ARG = -0x7;
036:
037:            /**
038:             * The method name.
039:             */
040:            private String m_methodName;
041:
042:            /**
043:             * The method sig.
044:             */
045:            private String m_methodSignature;
046:
047:            /**
048:             * The method's parameter types.
049:             */
050:            private Type[] m_methodParameterTypes;
051:
052:            /**
053:             * The advice name
054:             * <adviceMethodName>[(... call signature)]
055:             */
056:            private final String m_name;
057:
058:            /**
059:             * The aspect class name where this advice is defined.
060:             */
061:            private String m_aspectClassName;
062:
063:            /**
064:             * The aspect qualified name - <uuid>/<aspectNickName or FQNclassName>
065:             */
066:            private String m_aspectQualifiedName;
067:
068:            /**
069:             * The aspect deployment model
070:             */
071:            private DeploymentModel m_aspectDeploymentModel;
072:
073:            /**
074:             * The advice method arg index mapped to the advisED target arg index.
075:             * If the value is greater or equal to 0, it is an args binding. Else, it is a magic index
076:             * (see constants JOINPOINT_ARG, STATIC_JOINPOINT_ARG, THIS_ARG, TARGET_ARG)
077:             */
078:            private int[] m_methodToArgIndexes;
079:
080:            /**
081:             * The "special" argument type desc for the advice.
082:             */
083:            private String m_specialArgumentTypeDesc;
084:
085:            /**
086:             * The "special" argument type name for the advice.
087:             */
088:            private String m_specialArgumentTypeName;
089:
090:            /**
091:             * The advice type.
092:             */
093:            private AdviceType m_type;
094:
095:            /**
096:             * Runtime check flag.
097:             */
098:            private boolean m_targetWithRuntimeCheck;
099:
100:            /**
101:             * The expression info.
102:             */
103:            private ExpressionInfo m_expressionInfo;
104:
105:            /**
106:             * The expression context.
107:             */
108:            private ExpressionContext m_expressionContext;
109:
110:            /**
111:             * The advice definition for this advice.
112:             */
113:            private AdviceDefinition m_adviceDef;
114:
115:            /**
116:             * TODO refactor - many member fields holds data that is in either the adviceDef (which is in the class) or the aspectDef (which is accessible from the adviceDef)
117:             * <p/>
118:             * Creates a new advice info.
119:             *
120:             * @param aspectQualifiedName
121:             * @param aspectClassName
122:             * @param aspectDeploymentModel
123:             * @param methodName
124:             * @param methodSignature
125:             * @param methodParameterTypes
126:             * @param type                   the advice type
127:             * @param specialArgumentType    the special arg type
128:             * @param adviceName             full qualified advice method name (aspectFQN/advice(call sig))
129:             * @param targetWithRuntimeCheck true if a runtime check is needed based on target instance
130:             * @param expressionInfo
131:             * @param expressionContext
132:             * @param adviceDef
133:             */
134:            public AdviceInfo(final String aspectQualifiedName,
135:                    final String aspectClassName,
136:                    final DeploymentModel aspectDeploymentModel,
137:                    final String methodName, final String methodSignature,
138:                    final Type[] methodParameterTypes, final AdviceType type,
139:                    final String specialArgumentType, final String adviceName,
140:                    final boolean targetWithRuntimeCheck,
141:                    final ExpressionInfo expressionInfo,
142:                    final ExpressionContext expressionContext,
143:                    final AdviceDefinition adviceDef) {
144:                m_aspectQualifiedName = aspectQualifiedName;
145:                m_aspectClassName = aspectClassName;
146:                m_aspectDeploymentModel = aspectDeploymentModel;
147:                m_methodName = methodName;
148:                m_methodSignature = methodSignature;
149:                m_methodParameterTypes = methodParameterTypes;
150:                m_type = type;
151:                if (specialArgumentType != null
152:                        && specialArgumentType.length() > 0) {//AW-434
153:                    m_specialArgumentTypeDesc = AsmHelper
154:                            .convertReflectDescToTypeDesc(specialArgumentType);
155:                    m_specialArgumentTypeName = specialArgumentType.replace(
156:                            '.', '/');
157:                }
158:                m_name = adviceName;
159:                m_targetWithRuntimeCheck = targetWithRuntimeCheck;
160:                m_expressionInfo = expressionInfo;
161:                m_expressionContext = expressionContext;
162:                m_adviceDef = adviceDef;
163:            }
164:
165:            /**
166:             * Return the method name.
167:             *
168:             * @return the method name
169:             */
170:            public String getMethodName() {
171:                return m_methodName;
172:            }
173:
174:            /**
175:             * Return the method signature.
176:             *
177:             * @return the method signature
178:             */
179:            public String getMethodSignature() {
180:                return m_methodSignature;
181:            }
182:
183:            /**
184:             * Return the method name.
185:             *
186:             * @return the method name
187:             */
188:            public Type[] getMethodParameterTypes() {
189:                return m_methodParameterTypes;
190:            }
191:
192:            /**
193:             * Returns the aspect qualified name.
194:             *
195:             * @return the aspect qualified name
196:             */
197:            public String getAspectQualifiedName() {
198:                return m_aspectQualifiedName;
199:            }
200:
201:            /**
202:             * Returns the aspect FQN className.
203:             *
204:             * @return the aspect class name
205:             */
206:            public String getAspectClassName() {
207:                return m_aspectClassName;
208:            }
209:
210:            /**
211:             * Returns the aspect deployment model
212:             *
213:             * @return
214:             */
215:            public DeploymentModel getAspectDeploymentModel() {
216:                return m_aspectDeploymentModel;
217:            }
218:
219:            /**
220:             * Returns the name of the advice.
221:             *
222:             * @return
223:             */
224:            public String getName() {
225:                return m_name;
226:            }
227:
228:            /**
229:             * Sets the advice method to target method arg mapping A value of -1 means "not mapped"
230:             *
231:             * @param map
232:             */
233:            public void setMethodToArgIndexes(final int[] map) {
234:                m_methodToArgIndexes = map;
235:            }
236:
237:            /**
238:             * Returns the advice method to target method arg index mapping.
239:             *
240:             * @return the indexes
241:             */
242:            public int[] getMethodToArgIndexes() {
243:                return m_methodToArgIndexes;
244:            }
245:
246:            /**
247:             * Returns the special argument type desc.
248:             *
249:             * @return
250:             */
251:            public String getSpecialArgumentTypeDesc() {
252:                return m_specialArgumentTypeDesc;
253:            }
254:
255:            /**
256:             * Returns the special argument type name.
257:             *
258:             * @return
259:             */
260:            public String getSpecialArgumentTypeName() {
261:                return m_specialArgumentTypeName;
262:            }
263:
264:            /**
265:             * Returns the advice type.
266:             *
267:             * @return
268:             */
269:            public AdviceType getType() {
270:                return m_type;
271:            }
272:
273:            /**
274:             * Checks if the target has a runtime check.
275:             *
276:             * @return
277:             */
278:            public boolean hasTargetWithRuntimeCheck() {
279:                return m_targetWithRuntimeCheck;
280:            }
281:
282:            /**
283:             * Returns the expression info.
284:             *
285:             * @return
286:             */
287:            public ExpressionInfo getExpressionInfo() {
288:                return m_expressionInfo;
289:            }
290:
291:            /**
292:             * Returns the expression context.
293:             *
294:             * @return
295:             */
296:            public ExpressionContext getExpressionContext() {
297:                return m_expressionContext;
298:            }
299:
300:            /**
301:             * Returns the advice definition.
302:             *
303:             * @return
304:             */
305:            public AdviceDefinition getAdviceDefinition() {
306:                return m_adviceDef;
307:            }
308:
309:            public String toString() {
310:                StringBuffer sb = new StringBuffer("AdviceInfo[");
311:                sb.append(m_type).append(',');
312:                sb.append(m_aspectQualifiedName).append(',');
313:                sb.append(m_name).append(',');
314:                sb.append(m_methodName).append(',');
315:                sb.append(m_methodSignature).append(',');
316:                sb.append(m_methodParameterTypes).append(',');
317:                sb.append(m_specialArgumentTypeDesc).append(',');
318:                sb.append(m_expressionInfo).append(',');
319:                sb.append(m_expressionContext).append(',');
320:                sb.append(m_targetWithRuntimeCheck).append(']');
321:                sb.append(hashCode());
322:                return sb.toString();
323:            }
324:
325:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.