Source Code Cross Referenced for FieldTestAspect.java in  » Aspect-oriented » aspectwerkz-2.0 » test » 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 » Aspect oriented » aspectwerkz 2.0 » test.aspect 
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 test.aspect;
008:
009:        import test.FieldAdviceTest;
010:        import org.codehaus.aspectwerkz.definition.Pointcut;
011:        import org.codehaus.aspectwerkz.definition.Pointcut;
012:        import org.codehaus.aspectwerkz.joinpoint.FieldRtti;
013:        import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
014:
015:        /**
016:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
017:         * @Aspect perJVM
018:         */
019:        public class FieldTestAspect {
020:            // ============ Pointcuts ============
021:
022:            /**
023:             * @Expression set(* test.FieldAdviceTest.m_setFieldPreAdvice*)
024:             */
025:            Pointcut pc1;
026:
027:            /**
028:             * @Expression set(int test.FieldAdviceTest.m_setFieldPreAdvi*)
029:             */
030:            Pointcut pc2;
031:
032:            /**
033:             * @Expression set(* test.FieldAdviceTest.m_setFie*dPostAdviced)
034:             */
035:            Pointcut pc3;
036:
037:            /**
038:             * @Expression set(* test.FieldAdviceTest.m_se*FieldPostAdviced)
039:             */
040:            Pointcut pc4;
041:
042:            /**
043:             * @Expression set(* test.FieldAdviceTest.m_setFieldPrePostAdviced)
044:             */
045:            Pointcut pc5;
046:
047:            /**
048:             * @Expression get(* test.FieldAdviceTest.m_getFieldPreAdvic*)
049:             */
050:            Pointcut pc6;
051:
052:            /**
053:             * @Expression get(* test.FieldAdviceTest.m_getFieldPreAdvice*)
054:             */
055:            Pointcut pc7;
056:
057:            /**
058:             * @Expression get(* test.FieldAdviceTest.m_getFieldPostAdviced)
059:             */
060:            Pointcut pc8;
061:
062:            /**
063:             * @Expression get(* test.FieldAdviceTest.m_getFieldPrePostAdviced)
064:             */
065:            Pointcut pc9;
066:
067:            /**
068:             * @Expression set(* test.FieldAdviceTest.s_setStaticFieldPreAdvic*)
069:             */
070:            Pointcut pc10;
071:
072:            /**
073:             * @Expression set(* test.FieldAdviceTest.s_setStaticFieldPreAdvice*)
074:             */
075:            Pointcut pc11;
076:
077:            /**
078:             * @Expression set(* test.FieldAdviceTest.s_setStaticFieldPostAdviced)
079:             */
080:            Pointcut pc12;
081:
082:            /**
083:             * @Expression set(* test.FieldAdviceTest.s_setStaticFieldPrePostAdviced)
084:             */
085:            Pointcut pc13;
086:
087:            /**
088:             * @Expression get(* test.FieldAdviceTest.s_getStaticFieldPreAdvice*)
089:             */
090:            Pointcut pc14;
091:
092:            /**
093:             * @Expression get(* test.FieldAdviceTest.s_getStaticFieldPreAdvic*)
094:             */
095:            Pointcut pc15;
096:
097:            /**
098:             * @Expression get(* test.FieldAdviceTest.s_getStaticFieldPostAdviced)
099:             */
100:            Pointcut pc16;
101:
102:            /**
103:             * @Expression get(* test.FieldAdviceTest.s_getStaticFieldPrePostAdviced)
104:             */
105:            Pointcut pc17;
106:
107:            /**
108:             * @Expression set(* test.FieldAdviceTest.m_setFieldAroundAdviced)
109:             */
110:            Pointcut pc18;
111:
112:            /**
113:             * @Expression set(* test.FieldAdviceTest.s_setStaticFieldAroundAdviced)
114:             */
115:            Pointcut pc19;
116:
117:            /**
118:             * @Expression get(* test.FieldAdviceTest.m_getFieldAroundAdviced)
119:             */
120:            Pointcut pc20;
121:
122:            /**
123:             * @Expression get(* test.FieldAdviceTest.s_getStaticFieldAroundAdviced)
124:             */
125:            Pointcut pc21;
126:
127:            /**
128:             * @Expression set(* test.FieldAdviceTest.m_setFieldAroundAdviced*WithNullAdvice)
129:             */
130:            Pointcut pc22;
131:
132:            /**
133:             * @Expression get(* test.FieldAdviceTest.m_getFieldAroundAdvicedWithNullAdvice)
134:             */
135:            Pointcut pc23;
136:
137:            /**
138:             * @Expression set(* test.FieldAdviceTest.m_setFieldAroundAdvicedObjectWithAPI)
139:             */
140:            Pointcut pc24;
141:
142:            /**
143:             * @Expression set(* test.FieldAdviceTest.m_setFieldAroundAdvicedWithAPI)
144:             */
145:            Pointcut pc25;
146:
147:            /**
148:             * @Expression within(test.FieldAdviceTest)
149:             */
150:            Pointcut filter;
151:
152:            // ============ Advices ============
153:
154:            /**
155:             * @Before filter && (pc2 || pc5 || pc10 || pc13 || pc6 || pc9 || pc14 || pc17)
156:             */
157:            public void preAdvice1(final JoinPoint joinPoint) throws Throwable {
158:                FieldAdviceTest.log("pre1 ");
159:            }
160:
161:            /**
162:             * @Before filter && (pc1 || pc5 || pc11 || pc13 || pc7 || pc9 || pc15 || pc17)
163:             */
164:            public void preAdvice2(final JoinPoint joinPoint) throws Throwable {
165:                FieldAdviceTest.log("pre2 ");
166:            }
167:
168:            /**
169:             * @After filter && (pc4 || pc5 || pc12 || pc13 || pc8 || pc9 || pc16 || pc17)
170:             */
171:            public void postAdvice1(final JoinPoint joinPoint) throws Throwable {
172:                FieldAdviceTest.log("post1 ");
173:            }
174:
175:            /**
176:             * @After filter && (pc3 || pc5 || pc12 || pc13 || pc8 || pc9 || pc16 || pc17)
177:             */
178:            public void postAdvice2(final JoinPoint joinPoint) throws Throwable {
179:                FieldAdviceTest.log("post2 ");
180:            }
181:
182:            /**
183:             * @Around filter && (pc18 || pc19 || pc20 || pc21)
184:             */
185:            public Object around(final JoinPoint joinPoint) throws Throwable {
186:                FieldAdviceTest.log("before ");
187:                final Object result = joinPoint.proceed();
188:                FieldAdviceTest.log("after ");
189:                return result;
190:            }
191:
192:            /**
193:             * @Around filter && (pc22 || pc23)
194:             */
195:            public Object aroundNullAdvice(final JoinPoint joinPoint)
196:                    throws Throwable {
197:                FieldAdviceTest.log("before ");
198:                final Object result = joinPoint.proceed();
199:                FieldAdviceTest.log("after ");
200:                return null;
201:            }
202:
203:            /**
204:             * @Before get(java.io.PrintStream out) && withincode(* test.FieldAdviceTest.testPublicFieldOutOfWeaverScope())
205:             */
206:            public void beforePublicFieldOutOfWeaverScope() {
207:                FieldAdviceTest.log("adviceOnPublicField ");
208:            }
209:
210:            //TODO - activate when proceed(args) will be supported
211:
212:            //    /**
213:            //     * @Around pc24
214:            //     */
215:            //    public Object aroundAdviceAltering(final JoinPoint joinPoint) throws Throwable {
216:            //        FieldAdviceTest.log("before ");
217:            //        FieldRtti rtti = (FieldRtti) joinPoint.getRtti();
218:            //        rtti.setFieldValue(new String("byAdvice"));
219:            //        joinPoint.proceed();
220:            //        FieldAdviceTest.log("after ");
221:            //        return null;
222:            //    }
223:            //
224:            //    /**
225:            //     * @Around pc25
226:            //     */
227:            //    public Object aroundAdviceAlteringPrimitive(final JoinPoint joinPoint) throws Throwable {
228:            //        FieldAdviceTest.log("before ");
229:            //        FieldRtti rtti = (FieldRtti) joinPoint.getRtti();
230:            //        rtti.setFieldValue(new Integer(3));
231:            //        joinPoint.proceed();
232:            //        FieldAdviceTest.log("after ");
233:            //        return null;
234:            //    }
235:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.