Source Code Cross Referenced for StaticMethodTestAspect.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.StaticMethodAdviceTest;
010:        import org.codehaus.aspectwerkz.definition.Pointcut;
011:        import org.codehaus.aspectwerkz.definition.Pointcut;
012:        import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
013:        import org.codehaus.aspectwerkz.joinpoint.MethodRtti;
014:        import org.codehaus.aspectwerkz.joinpoint.Rtti;
015:
016:        /**
017:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
018:         * @Aspect perJVM
019:         */
020:        public class StaticMethodTestAspect {
021:            // ============ Pointcuts ============
022:
023:            /**
024:             * @Expression call(* test.StaticMethodAdviceTest.get*(..)) && within(test.StaticMethodAdviceTest)
025:             */
026:            Pointcut static_pc1;
027:
028:            /**
029:             * @Expression execution(* test.StaticMethodAdviceTest.*Param*(..))
030:             */
031:            Pointcut static_pc2;
032:
033:            /**
034:             * @Expression call(void test.StaticMethodAdviceTest.methodAdvicedMethod(..)) && within(test.StaticMethodAdviceTest)
035:             */
036:            Pointcut static_pc4;
037:
038:            /**
039:             * @Expression execution(* test.StaticMethodAdviceTest.methodAdvicedMethod(..))
040:             */
041:            Pointcut static_pc5;
042:
043:            /**
044:             * @Expression call(* test.StaticMethodAdviceTest.methodAdvicedMethodNewThread(..)) && within(test.StaticMethodAdviceTest)
045:             */
046:            Pointcut static_pc6;
047:
048:            /**
049:             * @Expression execution(* test.StaticMethodAdviceTest.multipleMethodAdvicedMethod(..))
050:             */
051:            Pointcut static_pc7;
052:
053:            /**
054:             * @Expression call(* test.StaticMethodAdviceTest.multipleChainedMethodAdvicedMethod(..)) && within(test.StaticMethodAdviceTest)
055:             */
056:            Pointcut static_pc8;
057:
058:            /**
059:             * @Expression execution(* test.StaticMethodAdviceTest.joinPointMetaData(..))
060:             */
061:            Pointcut static_pc9;
062:
063:            /**
064:             * @Expression call(void test.StaticMethodAdviceTest.multiplePointcutsMethod(..)) && within(test.StaticMethodAdviceTest)
065:             */
066:            Pointcut static_pc10;
067:
068:            /**
069:             * @Expression execution(void test.StaticMethodAdviceTest.multiplePointcutsMethod(..))
070:             */
071:            Pointcut static_pc11;
072:
073:            /**
074:             * @Expression call(* test.StaticMethodAdviceTest.takesArrayAsArgument(String[])) && within(test.StaticMethodAdviceTest)
075:             */
076:            Pointcut static_pc12;
077:
078:            /**
079:             * @Expression execution(long test.StaticMethodAdviceTest.getPrimitiveAndNullFromAdvice())
080:             */
081:            Pointcut static_pc13;
082:
083:            // ============ Advices ============
084:
085:            /**
086:             * @Before static_pc1 || static_pc2 || static_pc5 || static_pc8 || static_pc12
087:             */
088:            public void before(final JoinPoint joinPoint) throws Throwable {
089:            }
090:
091:            /**
092:             * @AfterFinally static_pc1 || static_pc2 || static_pc5 || static_pc8 || static_pc12
093:             */
094:            public void afterFinally(final JoinPoint joinPoint)
095:                    throws Throwable {
096:            }
097:
098:            /**
099:             * @Around static_pc1 || static_pc2 || static_pc5 || static_pc8 || static_pc12
100:             */
101:            public Object advice1(final JoinPoint joinPoint) throws Throwable {
102:                return joinPoint.proceed();
103:            }
104:
105:            /**
106:             * @Around static_pc4 || static_pc7 || static_pc8 || static_pc10
107:             */
108:            public Object advice2(final JoinPoint joinPoint) throws Throwable {
109:                StaticMethodAdviceTest.log("before1 ");
110:                final Object result = joinPoint.proceed();
111:                StaticMethodAdviceTest.log("after1 ");
112:                return result;
113:            }
114:
115:            /**
116:             * @Around static_pc7 || static_pc8 || static_pc11
117:             */
118:            public Object advice3(final JoinPoint joinPoint) throws Throwable {
119:                StaticMethodAdviceTest.log("before2 ");
120:                final Object result = joinPoint.proceed();
121:                StaticMethodAdviceTest.log("after2 ");
122:                return result;
123:            }
124:
125:            /**
126:             * @Around static_pc9
127:             */
128:            public Object advice4(final JoinPoint joinPoint) throws Throwable {
129:                final Object result = joinPoint.proceed();
130:                MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
131:                String metadata = joinPoint.getCalleeClass().getName()
132:                        + mrtti.getMethod().getName()
133:                        + mrtti.getParameterValues()[0]
134:                        + mrtti.getParameterTypes()[0].getName()
135:                        + mrtti.getReturnType().getName()
136:                        + mrtti.getReturnValue();
137:                return metadata;
138:            }
139:
140:            /**
141:             * @Around static_pc6
142:             */
143:            public Object advice5(final JoinPoint joinPoint) throws Throwable {
144:                StaticMethodAdviceTest.log("before ");
145:                final Object result = joinPoint.proceed();
146:                StaticMethodAdviceTest.log("after ");
147:                return result;
148:            }
149:
150:            /**
151:             * @Around static_pc13
152:             */
153:            public Object advice7(final JoinPoint joinPoint) throws Throwable {
154:                return null;
155:            }
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.