KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > performance > PerJVMPerformanceAspect


1 /**************************************************************************************
2  * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
3  * http://aspectwerkz.codehaus.org *
4  * ---------------------------------------------------------------------------------- *
5  * The software in this package is published under the terms of the LGPL license *
6  * a copy of which has been included with this distribution in the license.txt file. *
7  **************************************************************************************/

8 package test.performance;
9
10 import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
11 import org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint;
12
13 /**
14  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
15  * @Aspect perJVM
16  */

17 public class PerJVMPerformanceAspect {
18     /**
19      * Around execution(void test.performance.PerformanceTest.methodAdvisedMethodPerJVM())
20      *
21      * @Around call(void test.performance.PerformanceTest.methodAdvisedMethodPerJVM())
22      * &&
23      * within(test.performance.*)
24      */

25     public Object JavaDoc advice1(final StaticJoinPoint joinPoint) throws Throwable JavaDoc {
26         return joinPoint.proceed();
27     }
28
29     /**
30      * Around call(void test.performance.PerformanceTest.methodAdvisedMethodPerJVM()) &&
31      * within(test.performance.*)
32      */

33     public Object JavaDoc advice2(final JoinPoint joinPoint) throws Throwable JavaDoc {
34         return joinPoint.proceed();
35     }
36
37     /**
38      * Around call(void test.performance.PerformanceTest.methodAdvisedMethodPerJVM()) &&
39      * within(test.performance.*)
40      */

41     public Object JavaDoc advice3(final JoinPoint joinPoint) throws Throwable JavaDoc {
42         return joinPoint.proceed();
43     }
44
45     /**
46      * Around call(void test.performance.PerformanceTest.methodAdvisedMethodPerJVM()) &&
47      * within(test.performance.*)
48      */

49     public Object JavaDoc advice4(final JoinPoint joinPoint) throws Throwable JavaDoc {
50         return joinPoint.proceed();
51     }
52
53     /**
54      * Around call(void test.performance.PerformanceTest.methodAdvisedMethodPerJVM()) &&
55      * within(test.performance.*)
56      */

57     public Object JavaDoc advice5(final JoinPoint joinPoint) throws Throwable JavaDoc {
58         return joinPoint.proceed();
59     }
60
61     /**
62      * @Mixin within(test.performance.PerformanceTest)
63      */

64     public static class PerJVMImpl implements PerJVM {
65         public void runPerJVM() {
66         }
67     }
68 }
Popular Tags