Source Code Cross Referenced for TestAspect.java in  » Aspect-oriented » aspectwerkz-2.0 » test » annotation » 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.annotation 
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.annotation;
008:
009:        import org.codehaus.aspectwerkz.definition.Pointcut;
010:        import org.codehaus.aspectwerkz.definition.Pointcut;
011:        import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
012:
013:        /**
014:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
015:         * @Aspect perJVM
016:         */
017:        public class TestAspect {
018:            // ============ Pointcuts ============
019:
020:            /**
021:             * @Expression call(@AnnotationPrivateMethod * test.annotation.*.*(..)) &&
022:             * within(test.annotation.*)
023:             */
024:            Pointcut call_privateMethod;
025:
026:            /**
027:             * @Expression execution(@AnnotationPrivateMethod * test.annotation.*.*(..))
028:             */
029:            Pointcut execution_privateMethod;
030:
031:            /**
032:             * @Expression call(@AnnotationProtectedMethod * test.annotation.*.*(..)) &&
033:             * within(test.annotation.*)
034:             */
035:            Pointcut call_protectedMethod;
036:
037:            /**
038:             * @Expression execution(@AnnotationProtectedMethod * test.annotation.*.*(..))
039:             */
040:            Pointcut execution_protectedMethod;
041:
042:            /**
043:             * @Expression call(@AnnotationPackagePrivateMethod * test.annotation.*.*(..)) &&
044:             * within(test.annotation.*)
045:             */
046:            Pointcut call_packagePrivateMethod;
047:
048:            /**
049:             * @Expression execution(@AnnotationPackagePrivateMethod * test.annotation.*.*(..))
050:             */
051:            Pointcut execution_packagePrivateMethod;
052:
053:            /**
054:             * @Expression call(@AnnotationPublicMethod * test.annotation.*.*(..)) &&
055:             * within(test.annotation.*)
056:             */
057:            Pointcut call_publicMethod;
058:
059:            /**
060:             * @Expression execution(@AnnotationPublicMethod * test.annotation.*.*(..))
061:             */
062:            Pointcut execution_publicMethod;
063:
064:            /**
065:             * @Expression execution(@AnnotationPublicMethod2 * test.annotation.*.*(..))
066:             */
067:            Pointcut execution_publicMethod2;
068:
069:            /**
070:             * @Expression get(@AnnotationPrivateField * test.annotation.*.*) && within(test.annotation.*)
071:             */
072:            Pointcut get_privateField;
073:
074:            /**
075:             * @Expression set(@AnnotationPrivateField * test.annotation.*.*) && within(test.annotation.*)
076:             */
077:            Pointcut set_privateField;
078:
079:            /**
080:             * @Expression get(@AnnotationProtectedField * test.annotation.*.*) && within(test.annotation.*)
081:             */
082:            Pointcut get_protectedField;
083:
084:            /**
085:             * @Expression set(@AnnotationProtectedField * test.annotation.*.*) && within(test.annotation.*)
086:             */
087:            Pointcut set_protectedField;
088:
089:            /**
090:             * @Expression get(@AnnotationPackagePrivateField * test.annotation.*.*) && within(test.annotation.*)
091:             */
092:            Pointcut get_packagePrivateField;
093:
094:            /**
095:             * @Expression set(@AnnotationPackagePrivateField * test.annotation.*.*) && within(test.annotation.*)
096:             */
097:            Pointcut set_packagePrivateField;
098:
099:            /**
100:             * @Expression get(@AnnotationPublicField * test.annotation.*.*) && within(test.annotation.*)
101:             */
102:            Pointcut get_publicField;
103:
104:            /**
105:             * @Expression set(@AnnotationPublicField * test.annotation.*.*) && within(test.annotation.*)
106:             */
107:            Pointcut set_publicField;
108:
109:            // ============ Advices ============
110:
111:            /**
112:             * @Around call_privateMethod || call_protectedMethod || call_packagePrivateMethod ||
113:             * call_publicMethod
114:             */
115:            public Object advice_CALL(final JoinPoint joinPoint)
116:                    throws Throwable {
117:                AnnotationTest.log("call ");
118:                Object result = joinPoint.proceed();
119:                AnnotationTest.log("call ");
120:                return result;
121:            }
122:
123:            /**
124:             * @Around execution_privateMethod || execution_protectedMethod ||
125:             * execution_packagePrivateMethod || execution_publicMethod
126:             */
127:            public Object advice_EXECUTION(final JoinPoint joinPoint)
128:                    throws Throwable {
129:                AnnotationTest.log("execution ");
130:                Object result = joinPoint.proceed();
131:                AnnotationTest.log("execution ");
132:                return result;
133:            }
134:
135:            /**
136:             * @Around execution_publicMethod2
137:             */
138:            public Object advice_EXECUTION2(final JoinPoint joinPoint)
139:                    throws Throwable {
140:                AnnotationTest.log("execution2 ");
141:                Object result = joinPoint.proceed();
142:                AnnotationTest.log("execution2 ");
143:                return result;
144:            }
145:
146:            /**
147:             * @Around set_privateField || set_protectedField || set_packagePrivateField || set_publicField
148:             */
149:            public Object advice_SET(final JoinPoint joinPoint)
150:                    throws Throwable {
151:                AnnotationTest.log("set ");
152:                Object result = joinPoint.proceed();
153:                AnnotationTest.log("set ");
154:                return result;
155:            }
156:
157:            /**
158:             * @Around get_privateField || get_protectedField || get_packagePrivateField || get_publicField
159:             */
160:            public Object advice_GET(final JoinPoint joinPoint)
161:                    throws Throwable {
162:                AnnotationTest.log("get ");
163:                Object result = joinPoint.proceed();
164:                AnnotationTest.log("get ");
165:                return result;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.