01: /**************************************************************************************
02: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package test.abstractclass;
08:
09: import org.codehaus.aspectwerkz.definition.Pointcut;
10: import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
11:
12: /**
13: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
14: * @Aspect
15: */
16: public class TestAspect {
17:
18: static String s_log;
19:
20: /**
21: * @Expression execution(* test.abstractclass.AbstractTarget.*(..))
22: */
23: Pointcut pc;
24:
25: /**
26: * @Around pc
27: */
28: public Object advice(final JoinPoint joinPoint) throws Throwable {
29: s_log += joinPoint.getSignature().getName();//method name
30: return joinPoint.proceed();
31: }
32:
33: /**
34: * @Around execution(* test.abstractclass.AbstractTarget+.*(..))
35: */
36: public Object adviceOnAbstractMethod(final JoinPoint joinPoint)
37: throws Throwable {
38: s_log += joinPoint.getSignature().getName() + "XX";//method name + XX
39: return joinPoint.proceed();
40: }
41: }
|