blob: 54cbb6ac3ed6ffce890bae6ef757205f9360a07d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package test.aspects;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class MyAnnAspect {
@Pointcut("call(@MyAnn * *(..))")
void validatedMethod() {}
@Around("validatedMethod()")
public Object validateMethodImpl(ProceedingJoinPoint thisJoinPoint) throws Throwable {
return doInvoke(thisJoinPoint);
}
private Object doInvoke(final ProceedingJoinPoint thisJoinPoint) throws Throwable {
System.out.println("Invoking : " + thisJoinPoint);
return thisJoinPoint.proceed();
}
}
|