blob: 50d1d1dc9843f5dcf55598d68712180888a72798 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.DeclareParents;
@Aspect
public class TestAspect {
@DeclareParents(value="Foo+",defaultImpl=DefaultTestImpl.class)
public Test implementedInterface;
@Before("execution(* Foo.doSomething()) && this(t)")
public void verifyRunningSender(Test t) {
t.methodA();
t.methodB();
}
public static void main(String[] args) {
Foo foo = new FooImpl();
foo.doSomething();
}
}
|