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.abstractclass;
9   
10  import org.codehaus.aspectwerkz.definition.Pointcut;
11  import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
12  
13  /***
14   * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
15   * @Aspect
16   */
17  public class TestAspect {
18  
19      static String s_log;
20  
21      /***
22       * @Expression execution(* test.abstractclass.AbstractTarget.*(..))
23       */
24      Pointcut pc;
25  
26      /***
27       * @Around pc
28       */
29      public Object advice(final JoinPoint joinPoint) throws Throwable {
30          s_log += joinPoint.getSignature().getName();//method name
31          return joinPoint.proceed();
32      }
33  
34      /***
35       * @Around execution(* test.abstractclass.AbstractTarget+.*(..))
36       */
37      public Object adviceOnAbstractMethod(final JoinPoint joinPoint) throws Throwable {
38          s_log += joinPoint.getSignature().getName()+"XX";//method name + XX
39          return joinPoint.proceed();
40      }
41  }