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.adviseonintroducedinterface; 9 10 import org.codehaus.aspectwerkz.joinpoint.JoinPoint; 11 12 /*** 13 * @author <a href="mailto:jboner@codehaus.org">Jonas Bonér</a> 14 */ 15 public class Aspect { 16 17 /*** 18 * @Before 19 * (execution(void test.adviseonintroducedinterface.Intf1+.m1()) 20 * || 21 * execution(void test.adviseonintroducedinterface.Intf2+.m2()) 22 * ) && !within(test.adviseonintroducedinterface.Aspect$Mixin) 23 */ 24 public void before(JoinPoint jp) { 25 Test.log("before "); 26 } 27 28 29 /*** 30 * @Implements within(test.adviseonintroducedinterface.Target) 31 */ 32 Intf1 marker; 33 34 /*** 35 * @Introduce within(test.adviseonintroducedinterface.Target) 36 */ 37 public static class Mixin implements Intf2 { 38 public void m2() { 39 Test.log("m2 "); 40 } 41 } 42 }